My Tools Garage

HTML Entity Encode / Decode

Escape and unescape HTML entities.

in-browser
Encoded HTML

How to use

  1. 1 Paste text to escape, or HTML with entities to decode.
  2. 2 Choose Encode or Decode.
  3. 3 Optionally enable "Escape non-ASCII" for ASCII-only output.
  4. 4 Copy the result.

About HTML Entity Encode / Decode

HTML entities let you put reserved characters into a web page without the browser mistaking them for markup.

The ampersand, angle brackets and quotes all have special meaning inside HTML, so to display them as text — or to stop user input from breaking your page or opening an injection hole — they must be escaped to forms like &, <, > and ".

This tool encodes text to those entities, optionally escaping every non-ASCII character to a numeric &#NNN; reference for output that is safe to drop into any ASCII-only context.

Decoding works the other way and is deliberately broad: it understands the common named entities (amp, lt, gt, quot, apos, nbsp, copy, reg) as well as decimal references like é and hexadecimal ones like 🎉, turning them back into the characters they represent.

Unknown entities are left untouched rather than mangled.

The whole exchange happens in your browser, so you can clean up scraped markup, prepare a snippet for a blog post, or debug why a stray "<" is swallowing the rest of your content — all without sending anything anywhere.

It is a quick, reliable way to make text and markup get along.

FAQ

Which characters get escaped?

Always & < > " and '. With "Escape non-ASCII" on, every character above U+007F is also turned into a numeric reference.

Which entities can it decode?

Named entities amp, lt, gt, quot, apos, nbsp, copy and reg, plus any decimal (&#NN;) or hexadecimal (&#xHH;) numeric reference.