ToolsForWeb

Saved

Tap ☆ on any tool to keep it here.

toolsforweb

HTML Entity Encoder / Decoder

Escape text to HTML entities or decode them back, with two escape levels.

Runs in your browser — nothing is uploaded

Loading tool…

Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.

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 &#233;, 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 — &amp;, &nbsp;, &mdash;, &copy;, accented letters — and tolerates a missing semicolon the way browsers do.

When to use it

Embedding code snippets or user content in HTML without breaking the markup.
Making accented text or emoji survive a system that mangles UTF-8 (aggressive mode).
Cleaning up double-encoded text like &amp;amp; back to a single ampersand.
Checking what an entity string you found in the wild actually renders as.

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 &ampx stay unchanged?

It is not a known entity. Decoders match whole names, not prefixes — &ampx 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.

Related tools