HTML Entity Decoder

Turn &, <, ', and other named or numeric HTML entities back into the literal characters they represent. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-18

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 &lt; and numeric references like &#65; or &#x41; get converted back to the characters they represent.

Named and numeric entities work differently under the hood. Named entities like &amp; are a small, fixed vocabulary tied to specific characters. Numeric entities like &#65; or &#x41; 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 &#39; or &quot; 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 vs. Numeric HTML Entities
Named entityNumeric entity
Example for an ampersand&amp;&#38; or &#x26;
ReadabilityEasier to recognize by eyeRequires a lookup to read
Character coverageA limited common setAny Unicode code point
Decoded by this toolYes, the common named setYes, both decimal and hex

Examples

Decoding a scraped snippet

Input

Tom &amp; Jerry&#39;s &lt;show&gt;

Output

Tom & Jerry's <show>

The named entities &amp; and &#39;, plus the &lt;/&gt; pair, all convert back to their literal characters.

Decoding decimal and hexadecimal numeric entities

Input

&#65;&#66;&#67; and &#x1F389;

Output

ABC and 🎉

Decimal entities (&#65; etc.) and a hex entity (&#x1F389;, the party popper emoji's code point) both resolve via String.fromCodePoint, no matter which base the digits are written in.

An unrecognized named entity is left unchanged

Input

a &foo; b

Output

a &foo; b

&foo; isn't in the six-entry named-entity table this tool recognizes, so it passes through exactly as written instead of getting guessed at or dropped.

A malformed numeric entity is left unchanged

Input

a &#zz; b

Output

a &#zz; b

&#zz; doesn't match the pattern for a decimal or hex numeric entity, z isn't a valid digit in either base, so the entity-matching regex doesn't recognize it and leaves it as literal text.

Decoding a non-breaking space entity

Input

a&nbsp;b

Output

a b

&nbsp; decodes to U+00A0, the non-breaking space character. It looks like a regular space in most fonts but isn't, and it won't match a search for a plain ASCII space.

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 &nbsp; 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 (&copy;, &hearts;, 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 &nbsp; 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 &nbsp; hiding where you expected a regular space.

References

Frequently Asked Questions