Skip to content
tecuy
Developer & Data

HTML Entity Encoder / Decoder

Encode text for safe HTML use or decode HTML entities back to plain text — full numeric-entity support plus common named entities, no HTML parser involved.

Result

Enter text above.

What's actually covered

Encode escapes the five characters that matter for safe HTML text content: & < > " '. Decode handles every numeric character reference (&#65; and &#x41; forms, any codepoint, including emoji) plus 104 common named entities — not the complete HTML5 named character reference list, which has over 2,000 entries, many extremely obscure. An unrecognized named entity is left exactly as you typed it, never guessed at, and is listed above so you know it wasn't silently ignored. This never uses your browser's HTML parser to decode — it's a plain text transformation, so nothing you paste is ever interpreted as markup or executed.

This runs entirely in your browser — nothing you enter here is sent to a server.

Encode text for safe use as HTML content, or decode HTML entities back to plain text — numeric entities (decimal and hex, any codepoint, including emoji) are fully supported, plus a curated set of common named entities.

This never uses your browser's HTML parser to decode — it's a plain text transformation, so nothing you paste is ever interpreted as markup or executed.

How to use the HTML Entity Encoder / Decoder

  1. Choose Encode or Decode.
  2. Type or paste your text into the input box.
  3. Read the converted text under Result as you type.
  4. In Decode mode, check the note listing any named entities left as-is.
  5. Click Copy result, or Clear to start over.

Example: Escaping a snippet for display

In Encode mode, enter <a href="x">Tom & Jerry's</a> café. The result is &lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&#39;s&lt;/a&gt; café. The accented é is left unchanged.

Questions about the HTML Entity Encoder / Decoder

Why are accented letters and emoji not encoded?
Encode only escapes the five HTML-sensitive characters & < > " and '. Other characters stay as typed, which is fine in a page served as UTF-8.
Why does &amp;amp; decode to &amp; and not &?
Decoding runs once. Text that was encoded twice needs to be decoded twice.
What if an entity has no semicolon?
Entities must end with a semicolon to be decoded. Something like &amp without one is left unchanged and is not listed as unrecognized.
Which entities are reported as unrecognized?
Named entities outside the tool's list, such as &bogus;, are left as typed and listed under the result. Numeric entities like &#x1F600; always decode.