HTML Entity Escaper

How to use this HTML entity escaper

  1. Paste HTML or plain text into the input box.
  2. Choose "Escape" to convert special characters to entities, or "Unescape" to reverse it.
  3. The result updates instantly on the right.

Why escape HTML entities?

Characters like <, > and & have special meaning in HTML. Escaping them (turning < into &lt;, for example) lets you display code snippets or user-generated text safely, without the browser interpreting them as actual markup.

Does this prevent XSS attacks?

Escaping is one important layer of defense against cross-site scripting, but a complete security strategy also needs proper input validation and context-aware output encoding on the server side.

What's the difference between &#39; and &apos;?

Both represent an apostrophe. &#39; is the numeric entity supported everywhere, while &apos; is a named entity that older versions of Internet Explorer didn't fully support in HTML (only XML).