FormatterHQ

HTML Decode

Decode every HTML entity — named, decimal and hexadecimal — back into the characters they represent, using the complete HTML5 entity table.

Loading tool…
Ready.

How to use the HTML Decode

  1. Type or paste into the HTML entities box, or click Sample. You can also drop a text file on either box, or load one into the HTML entities box with its Open file button.
  2. The Text box updates live as you type. It works both ways — edit the Text side to convert back, or click ⇄ Swap to exchange the sides.
  3. Use named entities (©) and Encode every character in the options bar above the editors only affect the reverse direction — the HTML entities output you get when you type in the Text box.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

HTML decode entities into characters

The HTML decode tool converts character references back into real characters. It understands the full list of named references from the HTML5 specification as well as decimal (é) and hexadecimal (é) numeric references, for any Unicode character including emoji.

Example

Encoded input:

<p>Café crème © 2024 — €3.50 & "free" 🚀</p>

Decoded output:

<p>Café crème © 2024 — €3.50 & "free" 🚀</p>

Every entity in the input was converted: the named ones through the HTML5 table and the numeric ones directly from their code points, including the rocket emoji from its decimal reference. Characters that were already plain text simply pass through.

Where entity-encoded text comes from

  • Web scraping output and the HTML source of pages, especially from CMSs that encode every non-ASCII character.
  • RSS and Atom feeds, whose titles and summaries are often entity-encoded once or even twice.
  • Database fields filled by forms that encoded input before storing it.
  • Email templates and newsletters exported as HTML.
  • API responses from services that HTML-encode strings “for safety”.

How decoding handles edge cases

  • Missing semicolons. HTML5 lets a few legacy entities work without a semicolon, for example &copy 2024. The decoder follows the same rules as browsers.
  • Invalid code points. References such as &#0; or values in the surrogate range are replaced with the Unicode replacement character, exactly as a browser does.
  • Double encoding. &amp;eacute; decodes to &eacute;, not é. Decode again to remove the second layer.
  • Plain text. Anything that is not an entity passes through unchanged, so you can paste mixed content safely.

Decoding entities in code

Python’s html.unescape() understands the full HTML5 list. In PHP, use html_entity_decode($s, ENT_QUOTES | ENT_HTML5) — without ENT_HTML5, newer names such as &apos; may be left alone. Java developers typically use StringEscapeUtils.unescapeHtml4() from Apache Commons Text, which covers the HTML 4 names only. In the browser, avoid the old trick of assigning text to innerHTML to decode it: with untrusted input it can execute scripts.

Decoding does not remove tags: &lt;p&gt; turns into a real <p>. If you want text only, run the result through the HTML Stripper. To encode text again, use HTML Encode.

The decoder runs in your browser and does not upload anything.

A safe way to decode in the browser

If you need to decode entities in front-end code, parse the string into a separate document instead of a live element. Documents created by DOMParser do not run scripts or load images, so hostile input cannot execute:

function decodeEntities(s) {
  return new DOMParser()
    .parseFromString(s, 'text/html')
    .documentElement.textContent;
}

decodeEntities('Caf&eacute; &amp; cr&#xE8;me');   // "Café & crème"

Note that this also drops any real tags in the input, keeping only their text. In Node.js, where there is no DOM, the he package offers he.decode() with the full HTML5 entity list.

Frequently asked questions

Does it support all HTML5 named entities?
Yes. The decoder uses the complete HTML5 named character reference table, including rarely used names such as &NotEqualTilde; and &bigstar;.
Why is &amp;eacute; decoded to &eacute; and not é?
The text was encoded twice. One decode removes one layer; copy the result back into the HTML entities box to decode it again and get é.
Is HTML decode the same as HTML unescape?
Yes, both terms describe converting entities back into characters. This site offers both tools; they use the same HTML5 decoder.
Can decoding make text unsafe?
It can. Decoded text may contain real tags or scripts, so escape it again before inserting it into a web page.

Last updated October 3, 2026

Related tools