Developer tools · free · no signup

HTML Entity Encoder & Decoder

Escape HTML-sensitive characters or restore encoded text. Your work stays on this device whenever possible.

Free to useNo accountClear results
Preparing tool…
Simple, transparent workflow

How to use HTML Entity Encoder & Decoder

  1. Paste markup or plain text into "HTML markup or text with special characters"; a review card with quotes, a euro sign and stars is preloaded.
  2. Set "Action" to "Encode characters to HTML entities" or "Decode HTML entities back to text".
  3. When encoding, pick an "Entity Format": named, decimal numeric or hexadecimal numeric.
  4. Choose an "Encoding Scope": special syntax characters only, syntax characters plus every non-ASCII character, or every character including letters and digits.
  5. Press "Convert Entities", then read the notice for the count of converted characters and the size change, and compare with the "Live HTML Visual Render" box.

Worked example

Enter 5 < 7 & "ok" followed by a euro sign, with Encode, Named and the non-ASCII scope. The output is 5 &lt; 7 &amp; &quot;ok&quot; &euro; and the notice counts 5 converted characters. Changing the format to hexadecimal gives 5 &#x3C; 7 &#x26; &#x22;ok&#x22; &#x20AC;, with the euro sign written as its code point 20AC.

When to use this tool

  • Escaping a code sample so it displays inside a blog post rather than running.
  • Making a copyright line safe for an RSS feed by using numeric entities.
  • Reading a scraped snippet full of &amp; and &quot; back into normal text.

Important limitations

Named entities require HTML5 parser support. Decimal and hexadecimal numeric entities provide wider compatibility across XML, RSS feeds, and legacy parsers.

Frequently asked questions

Which characters actually get a named entity?

Only about thirty: the five syntax characters plus common symbols such as cent, pound, yen, euro, copyright, registered, trademark, degree, dashes, curly quotes, ellipsis, times and divide. Anything else, a star or an accented letter for example, quietly falls back to a decimal entity even in named mode.

Why does the apostrophe become &apos;?

That entity is valid in HTML5 and XML but not in HTML 4, so very old parsers may show it literally. If you target legacy systems, choose a numeric format, which writes &#39; instead.

Does decoding keep my tags?

No. Numeric entities are swapped first, then the text is parsed as HTML and only its text is kept. Literal tags vanish, and an encoded &#60;b&#62; becomes a real tag that also vanishes. Decode plain text only.

How does it treat emoji?

Poorly. Characters outside the basic plane are processed as two halves, so a rocket emoji turns into two numeric entities that browsers will not render as the emoji. Leave such characters as literal UTF-8 rather than encoding them here.

When would I encode every character?

It turns letters and digits into numeric entities too, so Hi becomes &#72;&#105;. This can hide an address from naive scrapers but not determined ones, and the output grows several times larger, so use it sparingly.