HTML实体 编码器/解码器
Convert special characters to HTML entities and back. Named, numeric and hex formats — all in your browser.
| Char | Named | Numeric | Hex | Description |
|---|
如何编码和解码 HTML 实体
什么是 HTML 实体?
HTML 实体 是表示 HTML 中具有保留含义的字符或无法直接键入的字符的特殊代码。例如, & 代表一个 & 符号, < 小于号,并且 &复制; 版权符号。
如何对纯文本进行编码
将纯文本或 HTML 内容粘贴到左侧面板中,然后单击 编码。该工具将所有 HTML 敏感字符(&、<、>、引号)和任何扩展 Unicode 字符转换为安全的 HTML 实体代码。使用“格式”按钮选择“命名”、“数字”或“十六进制”输出。
如何将实体解码回文本
点击 解码 切换模式,然后粘贴 HTML 编码文本。该工具立即将所有实体引用解析回其原始字符。使用 交换 一键翻转输入和输出面板。
我应该选择哪种格式?
- 命名 — 人类可读(例如,&、©)。最适合代码可读性。
- 数字(十进制) — 通用(例如,&)。到处都受支持,包括 XML。
- 十六进制 — 紧凑的十六进制表示法(例如,&)。常见于 CSS 和 XML 上下文中。
常问问题
我的文本会发送到服务器吗?
不需要。ToolsPix HTML 实体编码器完全在您的浏览器中运行。您的输入永远不会传输到任何服务器,永远不会记录,也永远不会存储在您的设备之外。
该工具支持哪些编码格式?
Three formats are available: Named entities (e.g., &), Numeric decimal entities (e.g., &), and Hex entities (e.g., &). Switch between them with the Format buttons — the result updates instantly.
哪些字符被编码?
In 编码 mode, the five HTML-sensitive characters (&, <, >, ", ') are always encoded, plus any character with a Unicode code point above U+007F. Standard ASCII printable characters pass through unchanged.
如何解码 HTML 实体?
Click the 解码 button to switch modes, paste your HTML-encoded text into the left panel, and the decoded plain text appears instantly. Use the Swap button to quickly reverse the panels in one click.
它支持 Unicode 和特殊符号吗?
Yes. Common symbols like ©, ®, ™, €, and directional arrows have named entity equivalents. All other Unicode code points are encoded as numeric or hex entities covering the full Unicode range.