代码、数据与二维码工具

HTML编码器解码器

在浏览器中编码或解码HTML5字符引用;可选特殊字符或全部非ASCII、命名/十进制/十六进制形式及严格/浏览器兼容解码规则。

优先本地处理无需注册隐私说明 ↗

Maximum 100,000 characters. Output is always displayed as plain text.

使用步骤

如何使用

  1. Paste text or HTML character references up to 100,000 characters.
  2. Choose Encode or Decode, then select the range, entity style, or semicolon rule you need.
  3. Convert, review the plain-text result, and copy it.

Explicit encoding choices

Special-character mode encodes ampersand, angle brackets, double quotes, and apostrophes. The broader mode also encodes every non-ASCII Unicode code point. Choose HTML5 named references when available, decimal numeric references, or hexadecimal numeric references.

HTML5 decoding without rendering

The decoder recognizes HTML5 named references plus decimal and hexadecimal numeric references. Strict mode requires semicolons; browser-body mode also accepts the legacy semicolon-less references recognized in HTML text. Unknown references stay unchanged. The decoded result is shown as text and is never inserted as live HTML.

常见问题

你可能还想知道

Does encoding sanitize arbitrary HTML?

It escapes text for HTML text content and quoted attribute values. It is not a complete sanitizer for URLs, CSS, JavaScript, or already-structured markup.

What happens to an unknown entity?

It remains unchanged, so you can see and correct it rather than losing text.

Why can browser-compatible decoding work without a semicolon?

HTML permits a limited legacy set of named references without semicolons in text. Use strict mode when you require explicit, unambiguous references.