Home › Developer Tools › HTML Entity Encoder & Decoder

HTML Entity Encoder & Decoder

Show code as text on a web page, or turn entities back into readable characters.

  • Free & unlimited
  • No sign-up
  • Instant results

How to use the HTML Entity Encoder & Decoder

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

Why escape HTML?

Characters like < and & have meaning in HTML. To show code examples on a page, or to put user text into HTML safely, they must be written as entities: &lt;, &amp;. Escaping user input is a key defence against XSS attacks.

Decoding

The decoder understands named entities (&copy;, &nbsp;), decimal (&#169;) and hex (&#xA9;) forms.

Frequently asked questions

Which characters are encoded?

&amp;, &lt;, &gt;, double and single quotes. Tick the option to also encode all non-ASCII characters.

Is decoding safe?

Yes, the decoder never runs the HTML, it only converts entities to characters.

Is anything uploaded?

No, it runs in your browser.

Related tools