HTML Entity Decode

Decode HTML entities to text. Free HTML entity decoder.

Rate this tool

How useful was this tool?

HTML Entity Decode

Paste text into Text with HTML entities and it’s decoded as you type. The Decoded text shows the result. Above it is a summary such as “11 entities decoded in 1 pass”, with the number of characters before and after.

Below the result, a table lists every distinct entity in your text: the character it stands for, its code point, its kind (named, decimal or hex) and how many times it appeared.

Example loads a sample, Clear empties the box, Copy copies the result, and Use the result as input moves the result back into the box for another round.

Example

<p>Café & Bar – open 9 to 5, coffee €3 or $4</p>

decodes to:

<p>Café & Bar – open 9 to 5, coffee €3 or $4</p>

That’s 11 entities decoded in 1 pass, 98 characters down to 48. The table lists the 8 distinct ones:

Entity Character Code point Kind Count
&lt; < U+003C named 2
&gt; > U+003E named 2
&nbsp; no-break space U+00A0 named 2
&eacute; é U+00E9 named 1
&amp; & U+0026 named 1
&ndash; – U+2013 named 1
&#8364; € U+20AC decimal 1
&#x24; $ U+0024 hex 1

Invisible characters are named

Look at the spaces in “9 to 5” above. They’re no-break spaces, which look exactly like ordinary spaces once decoded. A plain decoder hides that, so the table names invisible characters instead of showing an empty cell: no-break space, zero-width space, soft hyphen and others.

It’s worth knowing they’re there. A no-break space keeps “9 to 5” on one line, which is what it’s for. But the same character makes a search for “9 to 5” fail, breaks a comparison in a spreadsheet, and causes a syntax error if it ends up in code. A zero-width space (&ZeroWidthSpace;) is invisible altogether, and a soft hyphen (&shy;) only shows where a word breaks across lines.

Double-encoded text

Sometimes text was encoded twice: once by one system, then again by the next. Tom &amp;amp; Jerry decodes, in one pass, to Tom &amp; Jerry, which still isn’t right. A second pass gives Tom & Jerry.

By default the tool decodes once. If the result still contains entities, it warns you and offers a second pass in one click. That’s deliberate: text can contain entities on purpose. A tutorial about HTML might say “write &amp;lt; to show &lt;”, and decoding until nothing is left would wipe out exactly what it means to show.

When you know the text was encoded several times over, tick Decode repeatedly until nothing is left (for double-encoded text). The summary then reports how many passes it took. Or use Use the result as input to step through one pass at a time.

The real fix for double encoding is upstream: one system is encoding text that’s already encoded. Decode it here to rescue the content, then make sure only one layer does the encoding.

How the awkward cases are decoded

Real-world text is full of entities that are slightly wrong. The tool decodes them the way browsers do, and a note says when one of these came up:

  • A name without a semicolon. For historical reasons, about a hundred old names work without their semicolon: &copy2026 becomes “©2026”. This is why a URL pasted into a page as plain text can get mangled. In ?id=5&lang=en&not=1&reg=2, &lang is left alone (it needs a semicolon), but &not and &reg become ¬ and ®: “?id=5&lang=en¬=1®=2”.
  • Numbers from the Windows-1252 range. References from &#128; to &#159; are, strictly, control codes. But old content, often typed in Word, used them for curly quotes and dashes. So browsers read them as Windows-1252 characters: &#147;quoted&#148; becomes “quoted”, &#150; becomes –, and &#128; becomes €. The correct modern forms are &#8220;, &#8221;, &#8211; and &#8364;.
  • Invalid numbers. &#0;, numbers in the range reserved for UTF-16 surrogates (such as &#xD800;), and anything beyond the last Unicode code point become the replacement character, �.
  • Unknown names. &foo; isn’t an entity, so it’s left exactly as written.

Where encoded text comes from

  • Scraped pages and feeds. HTML source and RSS feeds store text with entities, and copying them out keeps the entities.
  • APIs. WordPress’s REST API, for example, returns titles with the typographic quotes and dashes already encoded, like &#8217; for an apostrophe.
  • Exports. CSV files from a CMS or a shop often contain &amp; and &quot; where you expected plain text.
  • Email templates and older HTML written by editors that encode everything.

A word on safety

Decoding can turn harmless text into working HTML: &lt;script&gt; becomes <script>. That’s fine when you’re reading or cleaning content. But if the text came from someone else, don’t put the decoded result into a web page as HTML. Insert it as text, or encode it again with HTML Entity Encode.

FAQ

What’s the difference between named, decimal and hex entities?

They’re three ways of writing the same character: &amp;, &#38; and &#x26; are all “&”. Named entities only exist for some characters. Decimal and hex can write any character, emoji included. The table shows which kind each one was.

Does it decode %20 and other URL encoding?

No. That’s URL encoding, a different system. Use the URL Decoder. If text contains both, decode the HTML entities here first, then the URL encoding.

Why does the result still show &something;?

Either the text was encoded twice (look for the warning and the second-pass button), or the name isn’t a real entity. Unknown names are left as written.

Is my text sent anywhere?

No. Decoding happens in your browser, and nothing you paste is sent or stored.

Note: All processing is done client-side. We do not store or see your data.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us