HTML Entity Encoder / Decoder
Encode text to HTML entities (named, decimal or hex) and decode them back — side-by-side, live, with a full reference.
What this tool does
Text encodes into HTML entities and decodes back, side by side
and live, in named (©), decimal
(©), or hex (©) form.
Choosing how aggressively to escape
Not every situation needs the same amount of escaping, so three levels are available:
- Reserved only — just the characters that are
actually syntax-critical in HTML:
&,<,>,", and the apostrophe. Nothing else is touched. - Reserved plus non-ASCII — the same, plus every character outside the basic ASCII range, so accented letters, symbols, and emoji all become entities too.
- All non-alphanumeric — the most aggressive option, escaping anything that is not a plain letter or digit.
The right level depends on where the text is going — inserting into an existing HTML document usually only needs the reserved characters handled, while generating something meant to survive being pasted through less careful tooling benefits from escaping more.
Decoding the way a browser actually reads HTML
Rather than matching entities against a lookup table, decoding hands the text to the browser's own HTML parser and reads back what it produces — the same mechanism that actually renders a page, so obscure or malformed entities are handled exactly as a real browser would handle them, not approximately.
A correctness detail: the apostrophe
The apostrophe encodes as ' here rather
than the more obvious-looking ', because
' was never part of the HTML4 named-entity
set and historically was not recognized by every browser — the
numeric form works everywhere without exception.
Privacy
Encoding and decoding both happen in your browser. Nothing you paste, drop, or load from a file is sent to a server.
Frequently asked questions
Is my data uploaded anywhere?
What is the difference between the three encoding scopes?
Why does the apostrophe encode as ' instead of '?
Named, decimal, or hex entities -- which should be used?
How accurate is the decoding compared to how a browser actually reads HTML?
Can line breaks be converted into <br> tags?
tag during encoding, for text going somewhere that needs an explicit line break rather than a raw newline character.