HTML entity encoder & decoder
Escape text for safe placement inside HTML — &, <, >, " and the apostrophe
become their entity equivalents — or decode named and numeric entities back into
plain text. Escaping is the core defence against breaking your page layout or
introducing cross-site scripting when you display user-supplied text.
How it works
In encode mode the tool replaces each HTML-significant character with its
entity: & → &, < → <, > → >, " → ", and the
apostrophe → '. An optional setting additionally converts every non-ASCII
character (accents, symbols, emoji) into a numeric &#...; entity for maximum
compatibility. In decode mode it reverses the process, resolving named
entities and both decimal (&#NN;) and hexadecimal (&#xNN;) numeric forms — done
through a parser that never injects your input into the live DOM, so untrusted
markup cannot execute.
Example
Encoding <a href="x">Tom & Jerry</a> gives:
<a href="x">Tom & Jerry</a>
Decoding © 2026 — café gives © 2026 — café.
| Character | Named | Numeric |
|---|---|---|
| & | & | & |
< | < | < |
> | > | > |
| " | " | " |
Everything runs in your browser — nothing is uploaded. Pair it with the URL encoder for query strings.