HTML Entity Decoder

Decode HTML named, decimal, and hex entities back to plain text

Ad placeholder (leaderboard)

HTML entities are escape sequences that let you include reserved characters — like the ampersand or angle brackets — or any Unicode character inside HTML without the browser misinterpreting it. This tool decodes named, decimal, and hexadecimal entities back to plain text, and can also encode text into safe entities.

How it works

Every entity starts with an ampersand and ends with a semicolon. There are three forms:

&      named entity        -> &
A      decimal reference   -> A
A     hexadecimal reference -> A

To decode, the tool scans for these patterns. A named entity is looked up in a table of common names (such as amp, lt, copy, mdash, pound) to find its Unicode code point. A numeric reference is parsed as decimal, or as hexadecimal when it begins with #x, then converted with String.fromCodePoint. Anything that is not a recognised name or a valid code point is left exactly as written, so content is never silently corrupted.

Encoding direction

Encoding is the reverse: the HTML-significant characters &, <, >, ", and ' are replaced with their safe entity equivalents (&amp;, &lt;, &gt;, &quot;, &#39;). An optional setting also converts every non-ASCII character to a numeric reference, which is useful when a system can only transmit plain ASCII.

Example

The fragment Fish &amp; Chips &#8212; &pound;5 &#x263A; decodes to Fish & Chips — £5 ☺. Here &amp; is the named ampersand, &#8212; is the decimal code for an em dash, &pound; is the named pound sign, and &#x263A; is the hex code for a smiling face. All processing happens in your browser.

Ad placeholder (rectangle)