HTML Entity Encoder / Decoder
Encode text for safe embedding in HTML: basic mode escapes the five XML-critical characters (& < > " '), aggressive mode additionally turns every non-ASCII character into a numeric entity. Decoding handles decimal and hex numeric entities plus about 40 common named ones (&, , —, accented letters…), tolerates missing semicolons the way browsers do, and leaves unknown entities as literal text. Runs entirely in your browser.
About this tool
Escapes text for safe inclusion in HTML, or decodes entities back to characters. Basic mode escapes exactly the five characters that break HTML parsing: & < > " and '. Aggressive mode additionally converts every non-ASCII character (é, ☺, emoji) into a numeric entity like é, which is how you make arbitrary text survive any legacy charset or lossy pipeline. Decoding handles decimal and hex numeric entities plus around 40 common named ones — &, , —, ©, accented letters — and tolerates a missing semicolon the way browsers do.
When to use it
Questions
Basic or aggressive encoding?
Basic for normal HTML work — those five characters are the only ones that change how a page parses. Aggressive when text must pass through something that is not UTF-8-safe: every non-ASCII character becomes pure ASCII, at the cost of readability in the source.
Why did &x stay unchanged?
It is not a known entity. Decoders match whole names, not prefixes — &x is the unknown name "ampx", not amp followed by x — so it is left as literal text, exactly like a browser would render it. That behavior also makes typos visible instead of silently corrupting your text.
Are all HTML entities supported?
The named table covers the roughly 40 you actually meet in text: punctuation, symbols and common accented letters. Anything beyond that has a numeric form — every Unicode codepoint can be written as &#NNNN; — and numeric decoding always works, so nothing is undecodable.