HTML Escape / Unescape

Escape and unescape HTML special characters and entities.

Your text is escaped and unescaped locally in your browser and nothing is uploaded to a server.

Escaping text for JSON instead? Try JSON Escape / Unescape.

About HTML Escape / Unescape

The HTML entities encoder escapes HTML-special characters and unescapes entities back into plain text directly in your browser. In Escape mode it converts the five special characters & < > " and ' into their safe entity forms (&amp;, &lt;, &gt;, &quot;, &#39;), so you can escape HTML online and display code, tags, or user input inside markup without breaking it. In Unescape mode this html escape and unescape tool decodes named entities like &lt; and &nbsp;, plus decimal (&#39;) and hexadecimal (&#x27;) numeric references, back to the original characters. It is built for front-end and back-end developers, technical writers, and QA engineers who handle templates, email HTML, or scraped pages. Everything is processed locally, so your snippets never leave your device and there is no tracking.

Features

How to use the HTML Escape / Unescape

  1. Choose Escape to encode characters or Unescape to decode entities.
  2. Paste your text or HTML into the input box.
  3. Read the converted result in the output panel as you type.
  4. Click Copy to grab the escaped or unescaped output.

Example

Input

<a href="x">Tom & Jerry's</a>

Output

&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&#39;s&lt;/a&gt;

Escape mode turns markup and special characters into HTML-safe entities.

Common errors & troubleshooting

Frequently asked questions

What is the HTML entities encoder and what does it escape?
The HTML entities encoder escapes the five HTML-special characters: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot;, and ' becomes &#39;.
How do I unescape HTML entities back to text?
Switch the HTML entities encoder to Unescape mode and paste your text; it decodes &lt;, &gt;, &quot;, &apos; and &nbsp;, plus decimal (&#39;) and hexadecimal (&#x27;) numeric references.
Does escaping HTML make user input safe to display?
Escaping prevents markup injection when you output text as content, but you should still sanitise untrusted HTML before rendering it as markup.
Can the HTML entities encoder handle numeric character references?
Yes. Unescape mode converts both decimal references like &#169; and hexadecimal references like &#xA9; back into their characters.
Why does &amp; decode after the other entities?
The HTML entities encoder resolves &amp; last so that already-escaped sequences like &amp;lt; unescape one layer at a time instead of collapsing incorrectly.
Is my text uploaded anywhere when I use the HTML entities encoder?
No. The HTML entities encoder processes everything locally in your browser, so your text never leaves your device and there is no tracking.

Related tools

All ArrayKit tools