HTML Entity Encoder and Decoder

Escape text for safe use in HTML, or turn entities back into readable characters.

Loading tool...

How to use HTML Entity Encoder and Decoder

  1. Choose encode or decode.
  2. Paste your text or HTML.
  3. Copy the result.

About this tool

Encoding replaces &, <, >, quotation marks and apostrophes with entities so the text displays literally instead of being parsed as markup. You can also convert every non-ASCII character to a numeric entity for ASCII-only systems.

Decoding understands the common named entities plus decimal and hexadecimal numeric entities.

Frequently Asked Questions

Does encoding prevent XSS?
Escaping output is one part of preventing cross-site scripting, but the correct escaping depends on the context, so rely on your framework's built-in escaping.
Which named entities are supported when decoding?
The most common ones, such as &amp;, &lt;, &gt;, &quot;, &nbsp;, &copy; and &euro;, plus all numeric entities.

Related tools