Overview
Introduction
HTML source, RSS feeds, and scraped web content are full of entities like & and ' standing in for literal characters. This tool converts them back so you can read or reuse the underlying text.
Decoding is the read side of the encode/decode pair. You reach for it when text is already entity-escaped and you need to see or reuse the underlying characters, scraped page content, an RSS item, a database column storing HTML-escaped text. Since decoding can reveal characters like < and > that were previously hidden, anything you do with the output afterward needs its own escaping before it goes back into HTML.
What Is HTML Entity Decoder?
HTML decoding reverses entity encoding: named references like < and numeric references like A or A get converted back to the characters they represent.
Named and numeric entities work differently under the hood. Named entities like & are a small, fixed vocabulary tied to specific characters. Numeric entities like A or A can represent any Unicode code point at all, which is why feeds and CMS exports often reach for the numeric form outside basic Latin text.
How HTML Entity Decoder Works
The tool scans the input for entity patterns, looks named entities up in a small table of common cases, and converts numeric entities (decimal or hex) directly via their code point. Anything it doesn't recognize stays untouched.
The lookup table only covers common named entities rather than the full HTML5 named character reference list, which runs into the thousands, so anything outside that set is left alone rather than guessed at. It's a deliberate tradeoff. A wrong guess would silently corrupt the text, while leaving an unrecognized entity as literal characters is at least visible and easy to spot.
When To Use HTML Entity Decoder
Use it when reading raw HTML source, cleaning up text scraped from a web page, or inspecting an RSS/Atom feed item whose content is stored with entity-encoded characters.
It's especially handy right before doing anything else with scraped or fed content, search-and-replace, word counting, simple display, since entity-encoded text like ' or " won't match the plain characters you're looking for until it's decoded.
Often used alongside HTML Entity Encoder.
Features
Advantages
- Runs entirely client-side, useful for inspecting scraped or untrusted content without sending it anywhere.
- Handles both named and numeric (decimal and hex) entity formats.
- Leaves unrecognized entities intact instead of corrupting them with a bad guess.
Limitations
- Only recognizes a focused set of common named entities, not the full HTML5 named character reference table.
- Doesn't parse or render HTML tags. It only converts entity syntax, so markup itself passes through as literal text.
Named vs. Numeric HTML Entities
| Named entity | Numeric entity | |
|---|---|---|
| Example for an ampersand | & | & or & |
| Readability | Easier to recognize by eye | Requires a lookup to read |
| Character coverage | A limited common set | Any Unicode code point |
| Decoded by this tool | Yes, the common named set | Yes, both decimal and hex |
Examples
Best Practices & Notes
Best Practices
- Re-escape decoded text before inserting it back into HTML output to avoid introducing an injection risk.
- When processing feeds or scraped content, decode entities once as an explicit step rather than relying on ad hoc string replacement.
- Check the output for entities that were left unchanged. That signals a reference this tool doesn't recognize.
- Searching decoded text for a plain space? Remember decodes to U+00A0, not a regular ASCII space, and the two won't match in a naive string comparison.
- For entities outside the common set (©, ♥, and similar), look up the numeric code point and substitute it manually rather than assuming this tool resolves it.
Developer Notes
Named entities resolve through a small fixed lookup table of six entries (amp, lt, gt, quot, apos, nbsp). Numeric entities are matched by a single regular expression covering both decimal (#\d+) and hexadecimal (#x[0-9a-fA-F]+) forms and converted via String.fromCodePoint, so no DOM or HTML parser is involved anywhere in the process. Anything the regex doesn't match at all, an unrecognized named entity or malformed numeric syntax, is left completely untouched rather than partially processed. That's why the output never contains a partially-decoded or corrupted entity.
HTML Entity Decoder Use Cases
- Cleaning up text scraped from a web page for further processing
- Reading the entity-encoded content of an RSS or Atom feed item
- Manually inspecting HTML source to understand what text it actually represents
- Preparing entity-encoded database or CMS export values for search, comparison, or word counting
- Verifying which specific entities appear in a piece of content before deciding whether broader named-entity support is needed
Common Mistakes
- Forgetting to re-escape decoded text before displaying it back inside HTML, reopening an XSS risk.
- Assuming every entity will decode, when obscure or rarely used named entities outside the common set are left as-is.
- Treating a decoded as an ordinary space when comparing or searching text, when it's actually the distinct U+00A0 character.
- Assuming malformed entity syntax like &#zz; raises an error, when it's silently left as literal text instead.
Tips
- Output still showing &something; unchanged? That's an entity name this tool doesn't have in its table. Look it up manually.
- Pair with the HTML encode tool to re-escape text safely after inspecting it.
- If a search or comparison against decoded text isn't matching as expected, check for a stray U+00A0 from a decoded hiding where you expected a regular space.