Tool guide
About this tool.
HTML character references let markup represent characters such as < and & without treating them as tag syntax or the start of another reference.
Encode escapes &, <, >, double quotes and apostrophes while preserving other Unicode text; Decode resolves HTML named references and decimal or hexadecimal numeric references without rendering or executing markup.
- Prepare a literal markup example to display as text in an HTML page.
- Read escaped text, symbols and non-breaking spaces from a template, log or test fixture.
- Check one layer of escaping before inserting text into an HTML text node or a quoted attribute.
Choose Encode for literal text or markup, or Decode for text that contains character references.
Paste the source without adding surrounding quotes, or apply a sample; spaces and line breaks are preserved.
For Decode, write named references such as © and numeric references such as č or 🐎 with their trailing semicolon.
Run the conversion and copy the plain-text result, or use “Use result & reverse” to switch direction with the result as input.
- Encode: <b>A&B</b> → <b>A&B</b>
- Encode: "it's" → "it's"
- Decode: <b>A</b> → <b>A</b>
- Decode named symbols: © € — → © € —
- Decode numeric Unicode: č ✓ 🐎 → č ✓ 🐎
- Decode once: &lt; → < (not <)
- Decode recognizes the HTML named character reference table, including references that produce two Unicode code points; names are case-sensitive, so © and © are valid but &Copy; is not.
- A trailing semicolon is required: unknown names, malformed references and references without it remain unchanged; this intentionally avoids the legacy partial decoding a browser may apply to missing semicolons.
- Numeric references follow HTML rules: null, surrogate and out-of-range values become the replacement character �; some legacy values are remapped, for example € becomes €.
- Decode removes one escaping layer only; becomes an actual non-breaking space (U+00A0), not an ordinary space, and spaces, tabs and line breaks are preserved.
- Encoding also escapes existing ampersands: < becomes &lt;, so avoid encoding an already escaped value unless another layer is intentional.
- This is not an HTML sanitizer or an XSS validator; escaping for JavaScript, CSS, URLs and unquoted attributes requires different rules.