HTML Entity Encoder/Decoder

Convert special characters to HTML entities and vice versa.

Plain Text

HTML Entities

About this tool

Encoding replaces characters that have a special meaning in HTML, such as < and &, with safe entities. Use it to show code samples on a web page. Decoding turns entities back into plain characters.

How to use it

  1. To encode, paste text in the first box and press Encode.
  2. To decode, paste entities in the second box and press Decode.
  3. Copy the result.

Frequently asked questions

Which characters must be encoded in HTML?

Always <, > and &. Inside attribute values, also double and single quotes.

What does &amp;amp; mean?

It is the entity for an ampersand. Seeing it on a page usually means the text was encoded twice.

Does encoding protect against XSS?

It is one important part of the defence when you place user text into HTML, but the right escaping depends on where the text goes.