HTML Entity Encoder / Decoder
Escape text safely for use in HTML, or recover the original text from an entity-encoded string. Pick between minimal escaping (only the dangerous five — & < > " ') and full escaping of every non-ASCII character, and choose named (&), decimal (&), or hex (&) entity output. Decoding accepts all three forms in one pass.
<div class="hello">Tom & Jerry — "café" © 2026</div>
How to use
- Pick Encode or Decode.
- For encoding, choose minimal vs all non-ASCII, and named / decimal / hex.
- Paste your text — the result updates as you type.
- Swap reuses the output as the next input.
Frequently asked questions
- When should I use 'minimal' vs 'all non-ASCII'?
- Minimal is right for almost every HTML context — UTF-8 pages render é, 한, 中 etc. directly, so only the five characters that confuse the HTML parser need to be escaped. Use 'all non-ASCII' when the destination must stay in pure ASCII (e.g., legacy email templates).
- Named vs numeric entities — which is best?
- Named entities (©) are easier to read, decimal (©) and hex (©) work for any code point even if no name exists. All three decode the same.
- Does decoding handle &#xNN; and &#NN;?
- Yes. The decoder accepts named, decimal, and hex forms in a single pass.
- Are emoji and supplementary characters supported?
- Yes — encoding uses code points, so characters outside the BMP (😀, 𝕏, etc.) encode and decode correctly.
Guides on this topic
Related tools
String Escape Converter
Escape a string for 10 contexts at once — JavaScript, JSON, HTML entities, URL, SQL, regex, Bash (single/double quote), C string, Unicode \u escapes. Copy whichever you need.
URL Encoder / Decoder
Percent-encode text for URLs, or decode encoded URLs back to text.
CSS Named Colors
All 147 CSS / X11 named colors with HEX, RGB, and a live swatch — searchable and grouped by hue.
Unicode Escape Converter
Encode text to \uXXXX, U+XXXX or HTML entities — and decode any of those back to text. Handles emoji and astral characters.
Invisible / Zero-Width Character Detector
Spot NBSPs, zero-width characters, bidi marks, and tabs in pasted text — then clean them out.
ASCII Code Table
Browse and search the 256-row ASCII / extended-ASCII table — decimal, hex, octal, binary, and the named control characters.