HTML Entity Encoder & Decoder

Make text safe to show inside HTML, or turn &-style codes back into normal characters.

🔒 Your files and text never leave your device. Everything is processed in your browser.

How to use

  1. Choose Encode or Decode.
  2. Paste your text or HTML.
  3. Copy the result.

When characters must be escaped

In HTML, < and > start tags and & starts an entity, so showing them as text requires &lt;, &gt; and &amp;. Inside attribute values, quotes need &quot; too. Escaping user input before inserting it into a page is a basic protection against cross-site scripting.

Decoding entities

Text copied from page sources, feeds or emails often contains codes like &amp;nbsp; or &amp;#39;. Decoding turns them back into the readable characters.

Frequently asked questions

Why encode HTML?

So that characters like < and & display as text instead of being read as code.

Are named entities decoded?

Yes. Named, decimal and hex entities are all decoded.

Other free tools