HTML Entity Encode / Decode

Escape special characters to HTML entities or decode &, <, ' and numeric entities back to text. Free online HTML escape tool.

About this tool

Escape special characters as HTML entities or decode entities back to text. Useful when embedding user content in HTML or reading escaped API output.

How to use

  1. Select Encode or Decode.
  2. When encoding, optionally convert every non-ASCII character to a numeric entity.
  3. Paste the text and copy the result.

Frequently asked questions

Which characters are escaped?

The five characters with special meaning in HTML: & < > " and '. With the non-ASCII option, characters like é or 한 become &#x…; entities.

Which entities can be decoded?

All numeric entities (&#39;, &#x1F600;) and common named ones such as &amp;, &nbsp;, &copy; and &mdash;. Unknown names are left as they are.

Does escaping prevent XSS?

Escaping text before inserting it into HTML element content is one important step, but attributes, URLs and scripts need their own context-specific handling.

Related tools