& · © · …

HTML entity encoder and decoder

Turn markup into entities and back, with named or numeric output and a decoder that tells you when a name is not real.

0 characters

Conversion happens in this tab. Pasted markup — which often contains internal text — is never uploaded.

Short answer: pick a direction, paste the text, and the result appears as you type. Use the minimal mode for HTML you are about to paste, and decode when a value from a database or an email shows up full of &.

Why double-escaping happens

A URL parameter, a JSON field and an HTML attribute are three different layers. Escape the same value twice — once for JSON and again for HTML — and & becomes&, which renders as literal &. Decoding once is correct; decoding until it stops changing is how text like AT&T turns into AT&T with a broken ampersand.

Where escaping is the wrong tool

Entity questions

Which characters need escaping in HTML?

Five: & < > " and '. In text content only & and < are strictly required; in an attribute the quote you used matters. Escaping all five is the safe default and is what the minimal mode does — it costs a few bytes and removes a class of bugs.

What is the difference between named and numeric entities?

Named entities (&amp;, &copy;, &hellip;) are readable; numeric ones (&#38;, &#169;, &#8230;) are unambiguous. Numeric forms work for every Unicode codepoint, including emoji, while the named set is a fixed list. Named mode uses a name when one exists and falls back to decimal.

Why does decoding stop on an unknown name?

Because the alternative is a tool that looks like it decoded and did not. If &bogus; were left as literal text, the output would be silently wrong; refusing lets you see that the input was not the entity you thought it was.

How many named entities are supported?

About 150 — the set forms, CMSes, email templates and documentation actually emit, including the punctuation and Greek letters. The full HTML5 list has 2,231 names; this page says which one it implements rather than implying it knows them all.

Does escaping protect against XSS?

Not on its own. Entity-escaping is correct for text and quoted attributes, but a value placed in an unquoted attribute, inside a <code>script</code> block or in a URL is a different context with different rules. Server-side output encoding per context is the control; this page is a convenience, not a security boundary.

Related tools