HTML Entities Encoder / Decoder

Escape text to HTML entities, or unescape entities back to readable text. Named, decimal and hex forms all handled.

How to use

  1. Paste text on the left. Encode escapes & < > " ' — the essentials for safe HTML.
  2. Enable Encode all non-ASCII to also convert accented letters, CJK and emoji to numeric references (email-template friendly).
  3. Decode converts entities back — including &amp; &lt; &#8212; &#x1F600; and any other named or numeric form.

Frequently asked questions

What are HTML entities and when do I need them?

HTML entities let you display characters that would otherwise be interpreted as markup: < becomes &lt;, & becomes &amp;. You need them whenever user-supplied text is placed inside HTML — both to render correctly and to prevent XSS.

What is the difference between named, decimal and hex entities?

All three refer to the same character: &amp; (named), &#38; (decimal) and &#x26; (hexadecimal). Named entities are most readable, numeric references cover every Unicode code point with no name needed. Browsers treat them identically.

Which characters should I always escape?

At minimum the big five: & < > " and '. Escaping & and < is essential for valid HTML; the quotes matter inside attribute values. This tool's smart mode escapes exactly those and leaves the rest human-readable.

Related tools

Copied