& HTML 实体解码器 — 在线解码 HTML
Decode HTML entities like & < > back to readable text. Also encode text to named, decimal, or hex entities. 100% browser-based.
Paste HTML-encoded text like &lt;div&gt; and click Decode to get back readable <div>. Or switch to Encode mode to convert special characters to safe HTML entities before inserting user content into your HTML pages to prevent XSS.
How to Use
Paste your text
Paste HTML, code, or any text containing characters you want to encode or entity codes you want to decode.
Choose mode
Select Encode (text → entities) or Decode (entities → text). Toggle "Non-ASCII only" for partial encoding.
Copy the result
The output updates instantly. Click Copy to clipboard to use in your project.
Frequently Asked Questions
完整指南:HTML实体编码/解码工具
什么是HTML实体?
HTML实体表示特殊字符:<→<,&→&。三种格式:命名(©)、十进制(©)、十六进制(©)。
如何使用
- 粘贴含特殊字符的文本。
- 选择模式:编码或解码。
- 复制结果用于HTML。
专业技巧
- 在HTML中插入用户内容时始终编码
<、>、&、"以防止XSS。 - 使用UTF-8编码时,大多数Unicode字符不需要编码为实体。
- 在带引号的HTML属性中尤为重要。