# HTML Entity Encoder / Decoder 在线工具

URL: https://caijiao.org/tool/html-entity-encoder-decoder
Source: docs/tool/html-entity-encoder-decoder.md
Description: HTML Entity Encoder / Decoder 在线工具，对 、&、引号等字符进行 HTML 实体编码和解码，适合示例展示和内容转义。

HTML Entity 工具用于把特殊字符编码为实体，或把实体解码回原始文本。适合展示 HTML 示例、排查转义问题和处理内容片段。

## 常见问题

- 编码 HTML 实体不等同于完整的 XSS 防护。
- 在属性、脚本、URL 等不同上下文中，需要使用不同转义策略。
- 如果要渲染用户输入，优先使用框架的默认转义能力。

## 相关内容

- [HTML 教程](/html/)
- [HTML Reference](/reference/html/)
- [JSON Formatter](/tool/json-formatter)
