An HTML entity encoder and decoder for developers, writers and content editors who need to move text safely in and out of HTML. It does three jobs in one place: escape the reserved characters that would otherwise break your markup, encode any text into named or numeric character references, and decode existing entities back into plain readable text. A searchable reference table of common named entities sits underneath so you can look up, copy or insert the exact code for a symbol without leaving the page.
How it works
HTML treats a handful of characters specially. The ampersand starts an entity, the angle brackets open and close tags, and quotes delimit attribute values. If those characters appear literally in your content the browser can misread them, so they have to be written as entities. The simplest case is escaping: this tool replaces only the five reserved characters with their safe forms, leaving everything else untouched. That is the form you want when you are injecting user text into a template.
Full encoding goes further. It walks your text one Unicode code point at a time and converts every reserved or non-ASCII character into an entity. When a readable named reference exists it uses that; otherwise it falls back to a numeric character reference, which you can request in decimal or hexadecimal. Because it iterates by code point, characters outside the basic plane — including emoji — are encoded correctly as single units rather than broken surrogate halves.
Decoding reverses the process with a pure parser. It scans for both named references and numeric references in decimal or hex, looks each one up, and substitutes the matching character. Crucially it never writes your text into the page, so decoding untrusted input carries no script-execution risk. Anything it does not recognise is reported and left exactly as it was, so you never silently lose data.
Example
Take the string Café "Ñoño" — 5 < 10 & 10 > 5 © 2026 €99.
- Escape HTML changes only the markup-breaking characters:
Café "Ñoño" — 5 < 10 & 10 > 5 © 2026 €99. - Encode all entities (named preferred) converts the accents and symbols too:
the copyright sign becomes the copyright named entity, the euro sign becomes the euro
named entity, and accented letters fall back to numeric references such as the one for
é. - Decode takes that fully encoded string and returns the original text byte-for-byte.
Use the Swap button to feed a result straight back as input and flip direction, which makes round-trip testing a single click. Every figure and character is processed in your browser — nothing is uploaded or stored.