HTML Entity Encoder / Decoder

Escape <, >, & and other special characters into safe HTML entities, or decode entities back to readable text — free and instant. Everything runs locally in your browser.

The five essential HTML characters (& < > " ') are always escaped. Enable the option above to also convert every non-ASCII character to a numeric entity.

How to use the HTML Entity Encoder / Decoder

  1. Pick a mode. Choose Encode to turn special characters into HTML entities, or Decode to turn entities such as &amp; back into plain characters.
  2. Set your options. When encoding, tick the box to also escape every accented letter, symbol and emoji as a numeric entity, and pick decimal or hexadecimal output. The result updates as you type.
  3. Copy or download. Grab the output with the copy button, save it as a file, or press Swap to feed the result back in and convert the other way.

About this tool

HTML entities let you display characters that would otherwise be interpreted as markup. Writing &lt; instead of < tells the browser to show a literal less-than sign rather than start a tag, and escaping &, " and ' prevents broken attributes and, more importantly, cross-site scripting when you insert untrusted text into a page. This encoder always escapes those five essential characters, and can optionally convert every non-ASCII character — accents, currency symbols, mathematical operators and emoji — into a numeric character reference so your markup stays pure ASCII and survives any file encoding.

The decoder turns entities back into readable text and understands all three forms: named references like &copy; and &nbsp;, decimal references like &#169;, and hexadecimal references like &#xA9;. Anything that is not a recognised entity is left untouched, so your text is never mangled. Emoji and astral-plane characters are handled correctly by iterating over full Unicode code points. All processing happens locally in your browser — nothing you paste is ever uploaded. For URL-safe escaping instead, see our URL Encode / Decode tool.

Frequently asked questions

Which characters are always encoded?

The five characters that are unsafe in HTML: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot;, and ' becomes &#39;. Escaping these is the core defence against breaking your markup or introducing an injection bug.

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

They all represent the same character. &copy; (named), &#169; (decimal) and &#xA9; (hexadecimal) all render as ©. Named entities are the most readable, while numeric entities work for any character even when no name exists. The decoder accepts all three.

Does it handle emoji and accented letters?

Yes. Encoding iterates over full Unicode code points, so multi-byte emoji like 😀 become a single correct numeric entity rather than two broken halves. Accented letters such as é and non-Latin scripts are encoded and decoded faithfully.

Is my text sent anywhere?

No. Encoding and decoding run entirely in your browser with plain JavaScript. Nothing you type is uploaded, logged or stored, so it is safe for private content and unpublished code.