HTML Entity Encoder & Decoder
Encode reserved HTML characters as entities or decode HTML entities back to readable text for snippets, CMS content, and templates.
HTML entity escaping is not a complete XSS sanitizer — it only changes representation. Processing stays in your browser.
Named uses & / < / > / ". Numeric uses decimal & / < / > / ". Decode accepts both. Escaping is not a full XSS sanitizer.
- Input0
- Output0
- OptionsNamed (&)
Input
Output
What is this tool?
This HTML entity converter encodes reserved markup characters (&, <, >, ", ') into HTML-safe entity text, and decodes entity text back to readable characters. Use Named (&, <) or Numeric (&, <) when encoding; decode accepts both.
Entity rules differ by context: text nodes, attributes, JavaScript strings, CSS, SVG, and XML are not identical. This page helps inspect snippets, CMS copy, and feed fields. Production rendering should still rely on framework escaping and a trusted sanitizer for untrusted HTML.
Conversion updates live in your browser. Nothing is uploaded.
Common use cases
- Show literal markup in docs or blog posts without the browser treating it as tags
- Fix or inspect double-encoded CMS / WYSIWYG content (
&amp;loops) - Prepare titles or descriptions for RSS/Atom and other XML-ish feeds where
&must be escaped
How to use
- Choose Encode or Decode. Results update as you type.
- On Encode, leave Numeric off for named entities (
<div>), or turn it on for decimal references (<div>). - Paste text or entity-encoded text. Use Sample for
<div>↔<div>. - Copy the output. For untrusted HTML, still sanitize—entity escape alone is not XSS defense.
Named vs numeric
| Input | Named encode | Numeric encode |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
Decode of either column returns the original input. Prefer named for readable source; prefer numeric when a consumer is picky about named references.
Examples
| Input / setting | Output | Notes |
|---|---|---|
<div> → Named encode | <div> | Markup shown as text. |
<div> → Decode | <div> | Round-trip of the sample. |
Tom & Jerry → Named | Tom & Jerry | Ampersand for HTML/XML text. |
A > B → Numeric | A > B | Same meaning as > when decoded (edge vs named). |
Practical pitfalls
- Escaping text is not the same as sanitizing HTML. Attribute injection,
javascript:URLs, and SVG/script contexts need different defenses. - Double encoding (
&lt;) is common after CMS round-trips; decode once and check whether another pass is still needed. - This tool escapes the five reserved characters only. It does not turn every Unicode character into a numeric entity (use Unicode encode/decode for
&#x…;code-point forms).
References
이 도구는 무엇인가요?
예약 문자(&, <, >, ", ')를 HTML 엔티티로 인코딩하거나, 엔티티를 읽기 쉬운 텍스트로 디코딩합니다. 인코딩 시 이름(&, <) 또는 숫자(&, <)를 고를 수 있고, 디코드는 둘 다 받습니다.
텍스트 노드·속성·스크립트·CSS·XML 규칙은 서로 다릅니다. 스니펫·CMS·피드 점검용이며, 신뢰할 수 없는 HTML에는 프레임워크 이스케이프와 sanitizer가 필요합니다. 변환은 브라우저에서만 실행됩니다.
자주 쓰는 경우
- 문서·블로그에서 마크업을 태그로 해석되지 않게 그대로 보여 주기
- CMS/WYSIWYG의 이중 인코딩(
&amp;) 확인·수정 - RSS/Atom 등 피드 제목·설명에서
&이스케이프 준비
사용 방법
- Encode 또는 Decode를 선택합니다. 입력하면 결과가 바로 갱신됩니다.
- Encode에서 Numeric을 끄면 이름 엔티티(
<div>), 켜면 십진 참조(<div>)입니다. - 텍스트 또는 엔티티를 붙여넣고 Sample로
<div>왕복을 확인합니다. - 결과를 복사합니다. 신뢰할 수 없는 HTML은 별도 살균이 필요합니다.
Named vs numeric
| 입력 | 이름 인코딩 | 숫자 인코딩 |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
예시
| 입력 / 설정 | 출력 | 메모 |
|---|---|---|
<div> → 이름 인코딩 | <div> | 마크업을 글자로 표시 |
<div> → 디코딩 | <div> | 샘플 왕복 |
Tom & Jerry → 이름 | Tom & Jerry | HTML/XML 텍스트용 & |
A > B → 숫자 | A > B | 디코드 시 >와 동일 |
실무에서 흔한 실수
- 텍스트 이스케이프 ≠ HTML 살균. 속성·
javascript:URL·SVG/스크립트는 별도 방어가 필요합니다. - CMS 왕복 후
&lt;처럼 이중 인코딩이 흔합니다. 한 번 디코드한 뒤 추가 패스가 필요한지 확인하세요. - 이 도구는 예약 문자 다섯 개만 이스케이프합니다. 모든 유니코드를
&#x…;로 바꾸는 용도가 아닙니다(그건 Unicode 도구).
참고자료
このツールについて
予約文字(& < > " ')を HTML エンティティへエンコードし、エンティティを読みやすいテキストへデコードします。エンコード時は 名前(& <)または 数値(& <)を選べ、デコードは両方受け付けます。
テキスト・属性・スクリプト・CSS・XML の規則は同一ではありません。スニペットや CMS、フィード確認向けで、信頼できない HTML にはフレームワークのエスケープとサニタイザが必要です。変換はブラウザ内だけです。
よくある用途
- ドキュメントやブログでマークアップをタグとして解釈させずに見せる
- CMS / WYSIWYG の二重エンコード(
&amp;)の確認・修正 - RSS/Atom などのフィード用タイトル・説明で
&をエスケープ
使い方
- Encode または Decode を選びます。入力に応じて結果が更新されます。
- Encode で Numeric をオフにすると名前実体、オンにすると十進参照になります。
- テキストまたはエンティティを貼り、Sample で
<div>の往復を確認します。 - 結果をコピーします。信頼できない HTML は別途サニタイズしてください。
Named vs numeric
| 入力 | 名前エンコード | 数値エンコード |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
例
| 入力 / 設定 | 出力 | メモ |
|---|---|---|
<div> → 名前 | <div> | マークアップを文字として表示 |
<div> → デコード | <div> | サンプルの往復 |
Tom & Jerry → 名前 | Tom & Jerry | HTML/XML テキスト向け & |
A > B → 数値 | A > B | デコード時は > と同じ |
実務での落とし穴
- テキストのエスケープは HTML サニタイズではありません。属性や
javascript:URL、SVG/スクリプトは別対策が必要です。 - CMS 往復後の
&lt;のような二重エンコードはよくあります。一度デコードして追加パスが要るか確認してください。 - 予約文字 5 種のみです。すべての Unicode を
&#x…;にする用途ではありません(Unicode ツールを使ってください)。
参考資料
¿Qué es esta herramienta?
Codifica caracteres reservados (&, <, >, ", ') como entidades HTML y decodifica entidades a texto legible. En encode elige con nombre (&, <) o numérico (&, <); decode acepta ambos.
Las reglas cambian según el contexto (texto, atributos, JS, CSS, XML). Sirve para snippets, CMS y feeds; el HTML no confiable sigue necesitando el escape del framework y un sanitizador. Todo corre en el navegador.
Casos de uso comunes
- Mostrar marcado literal en documentación o blogs sin que el navegador lo trate como etiquetas
- Revisar o corregir doble codificación de CMS/WYSIWYG (
&amp;) - Preparar títulos o descripciones para RSS/Atom donde
&debe escaparse
Cómo usar
- Elige Encode o Decode. El resultado se actualiza al escribir.
- En Encode, Numeric off = entidades con nombre; on = referencias decimales.
- Pega texto o entidades. Usa Sample para
<div>↔<div>. - Copia la salida. El escape solo no basta contra XSS.
Named vs numeric
| Entrada | Encode con nombre | Encode numérico |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
Ejemplos
| Entrada / ajuste | Salida | Notas |
|---|---|---|
<div> → nombre | <div> | Marcado visible como texto. |
<div> → decode | <div> | Ida y vuelta del sample. |
Tom & Jerry → nombre | Tom & Jerry | Ampersand para texto HTML/XML. |
A > B → numérico | A > B | Igual que > al decodificar. |
Errores prácticos
- Escapar texto ≠ sanitizar HTML. Atributos, URLs
javascript:y SVG/script necesitan otras defensas. - La doble codificación (
&lt;) es frecuente tras CMS; decodifica una vez y comprueba si hace falta otra pasada. - Solo escapa cinco caracteres reservados; no convierte todo Unicode a entidades (usa la herramienta Unicode).
Referencias
Qu'est-ce que cet outil ?
Encode les caractères réservés (&, <, >, ", ') en entités HTML et décode les entités en texte lisible. En encode, choisissez nommées (&, <) ou numériques (&, <) ; le décodage accepte les deux.
Les règles dépendent du contexte (texte, attributs, JS, CSS, XML). Utile pour snippets, CMS et flux ; le HTML non fiable exige toujours l’échappement du framework et un sanitizer. Tout s’exécute dans le navigateur.
Cas d'usage courants
- Afficher du balisage littéral dans docs ou blogs sans l’interpréter comme des balises
- Inspecter ou corriger le double encodage CMS/WYSIWYG (
&amp;) - Préparer titres ou descriptions RSS/Atom où
&doit être échappé
Comment utiliser
- Choisissez Encode ou Decode. Le résultat se met à jour en tapant.
- En Encode, Numeric off = entités nommées ; on = références décimales.
- Collez le texte ou les entités. Sample montre
<div>↔<div>. - Copiez la sortie. L’échappement seul ne remplace pas un sanitizer XSS.
Named vs numeric
| Entrée | Encode nommé | Encode numérique |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
Exemples
| Entrée / réglage | Sortie | Notes |
|---|---|---|
<div> → nommé | <div> | Balisage affiché comme texte. |
<div> → décode | <div> | Aller-retour de l’exemple. |
Tom & Jerry → nommé | Tom & Jerry | Esperluette pour texte HTML/XML. |
A > B → numérique | A > B | Même sens que > au décodage. |
Pièges courants
- Échapper du texte ≠ sanitizer HTML. Attributs, URLs
javascript:et SVG/script demandent d’autres défenses. - Le double encodage (
&lt;) est fréquent après un CMS ; décodez une fois puis vérifiez s’il faut une autre passe. - N’échappe que cinq caractères réservés ; ne convertit pas tout Unicode en entités (outil Unicode).
Références
这个工具是什么?
将保留字符(&、<、>、"、')编码为 HTML 实体,或将实体解码为可读文本。编码时可选择 命名(&、<)或 数字(&、<);解码两者都接受。
文本、属性、脚本、CSS、XML 规则并不相同。适合检查片段、CMS 与订阅源;不可信 HTML 仍需框架转义与可信 sanitizer。转换仅在浏览器中运行。
常见用途
- 在文档或博客中按字面显示标记,避免被当成标签解析
- 检查或修复 CMS/WYSIWYG 的双重编码(
&amp;) - 为 RSS/Atom 等订阅源准备需转义
&的标题或描述
如何使用
- 选择 Encode 或 Decode。输入时结果即时更新。
- Encode 时关闭 Numeric 使用命名实体,开启则使用十进制引用。
- 粘贴文本或实体。用 Sample 查看
<div>↔<div>。 - 复制输出。仅靠实体转义不能当作完整 XSS 防护。
Named vs numeric
| 输入 | 命名编码 | 数字编码 |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
示例
| 输入 / 设置 | 输出 | 说明 |
|---|---|---|
<div> → 命名 | <div> | 标记显示为文本 |
<div> → 解码 | <div> | 示例往返 |
Tom & Jerry → 命名 | Tom & Jerry | HTML/XML 文本中的 & |
A > B → 数字 | A > B | 解码后与 > 相同 |
实践中的常见误区
- 转义文本 ≠ 清理 HTML。属性、
javascript:URL、SVG/脚本需要其他防护。 - CMS 往返后常见双重编码(
&lt;);先解码一次再判断是否还需一轮。 - 只转义五个保留字符,不会把所有 Unicode 变成实体(请用 Unicode 工具)。
参考资料
這個工具是什麼?
將保留字元(&、<、>、"、')編碼為 HTML 實體,或將實體解碼為可讀文字。編碼時可選擇 命名(&、<)或 數字(&、<);解碼兩者都接受。
文字、屬性、腳本、CSS、XML 規則並不相同。適合檢查片段、CMS 與訂閱源;不可信 HTML 仍需框架跳脫與可信 sanitizer。轉換僅在瀏覽器中執行。
常見用途
- 在文件或部落格中依字面顯示標記,避免被當成標籤解析
- 檢查或修復 CMS/WYSIWYG 的雙重編碼(
&amp;) - 為 RSS/Atom 等訂閱源準備需跳脫
&的標題或描述
如何使用
- 選擇 Encode 或 Decode。輸入時結果即時更新。
- Encode 時關閉 Numeric 使用命名實體,開啟則使用十進位引用。
- 貼上文字或實體。用 Sample 查看
<div>↔<div>。 - 複製輸出。僅靠實體跳脫不能當作完整 XSS 防護。
Named vs numeric
| 輸入 | 命名編碼 | 數字編碼 |
|---|---|---|
<div> | <div> | <div> |
Tom & Jerry | Tom & Jerry | Tom & Jerry |
"quote" | "quote" | "quote" |
範例
| 輸入 / 設定 | 輸出 | 說明 |
|---|---|---|
<div> → 命名 | <div> | 標記顯示為文字 |
<div> → 解碼 | <div> | 範例往返 |
Tom & Jerry → 命名 | Tom & Jerry | HTML/XML 文字中的 & |
A > B → 數字 | A > B | 解碼後與 > 相同 |
實務上常見陷阱
- 跳脫文字 ≠ 清理 HTML。屬性、
javascript:URL、SVG/腳本需要其他防護。 - CMS 往返後常見雙重編碼(
&lt;);先解碼一次再判斷是否還需一輪。 - 只跳脫五個保留字元,不會把所有 Unicode 變成實體(請用 Unicode 工具)。
參考資料
Last reviewed: 2026-07-26
Frequently asked questions
- When should I encode HTML entities?
- Encode when text must display literally inside HTML—code samples, CMS fields, RSS/Atom titles, or user-provided snippets—so `<`, `>`, and `&` are not parsed as markup.
- Does this sanitize HTML or stop XSS?
- No. Entity encoding changes representation for text contexts. It is not a full HTML sanitizer and does not cover every XSS context (attributes, URLs, JavaScript, CSS). Use your framework’s escaping and a trusted sanitizer for untrusted HTML.
- What is the difference between named and numeric entities?
- Named forms like `&` and `<` are readable in source. Numeric forms like `&` and `<` are decimal character references and work the same when decoded. Decode accepts both; encode lets you prefer either style.
- Is input uploaded?
- No. Encode and decode run only in your browser.