HTML Entity Encoder

Escape HTML special characters so they display safely in code, or decode entities back into the characters they represent.

Your text is processed locally in your browser.

How to use HTML Entity Encoder

  1. Paste the text or HTML fragment.
  2. Choose “Encode” to escape special characters, or “Decode” to turn entities back into characters.
  3. The result updates automatically.
  4. Copy it with one click.

About this tool

When you write code examples, embed user content in a page, or work with XML and HTML templates, characters like &, < and > must be escaped to prevent them from being interpreted as markup.

The encoder covers the essential entities plus a full pass for non-ASCII characters, and the decoder understands both named entities (&amp;) and numeric ones (&#38;).

Frequently asked questions

What does encoding actually do?
It replaces characters that have special meaning in HTML — like < and & — with their entity equivalents, so they render as plain text instead of markup.
Which entities does the decoder recognise?
All numeric entities (decimal and hexadecimal) plus the common named ones such as &amp;, &lt;, &gt;, &quot;, &#39; and &nbsp;.

Related tools