How to use HTML Entities Decoder
- Paste the text containing HTML entities.
- The decoded text appears immediately.
- If entities remain in the output, it was double-encoded — run the result through again.
- Named, decimal and hexadecimal entities are all recognised.
- becomes a non-breaking space, not a regular one — they look identical and compare differently.
- Decoding runs in your browser; content is not uploaded.
Why entities exist at all
Four characters cannot appear literally in HTML where they would be read as markup: <, >, & and, inside attributes, the quote characters. Escaping them as entities is what stops a user’s comment containing a script tag from becoming a script tag — it is the foundation of cross-site scripting defence. Entities also cover characters that are hard to type or invisible, such as for a non-breaking space and — for an em dash.
Double encoding, and how to recognise it
Seeing &lt; in your output means the text was escaped twice: the & of < was itself escaped. It happens when text passes through two layers that each escape defensively — a CMS that escapes on save and a template that escapes on render. Decoding once gives you <; decoding again gives you <. The fix in the code is to escape at exactly one layer, normally at output, and never at storage.
Named, decimal and hexadecimal forms
The same character can be written three ways: &, & and & are all an ampersand. Named entities are readable but only cover a defined list; numeric forms work for any Unicode code point, which is why exported content often uses them for anything beyond ASCII. This decoder handles all three. Note that only &, <, >, " and ' are defined in XML — an XML parser will reject , which is a common surprise when HTML content is pasted into an XML feed.
The non-breaking space problem
decodes to U+00A0, which looks exactly like an ordinary space and behaves differently: it does not collapse, does not break a line, and does not match a space in a search or a comparison. Text pasted from a web page is full of them, and they are the usual reason two apparently identical strings do not match, or a whitespace cleaner leaves double spaces behind. Convert them explicitly if you are cleaning text for storage.
Frequently asked questions
Which HTML entities are decoded?
Can I decode HTML source code?
Is this safe to use on untrusted HTML?
What does &nbsp; mean?
Why do I still see &amp; after decoding?
Is HTML decoding safe?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.