Skip to main content

HTML Escape

Convert HTML special characters (& < > " ') to entities or back.

  • Runs in your browser
  • No sign-in needed

Text input

Result

Enter text and press [Escape] or [Unescape] — the result appears here.

How to use HTML Escape

When to use

Use to display HTML code samples as-is in a blog post, document, or forum, or to keep user input from being read as tags before inserting it into HTML. It also turns strings with entities like &lt; back into plain characters.

What to input

Enter text or HTML and press [Escape] or [Unescape]. Escaping converts the five characters & < > " ' to &amp; &lt; &gt; &quot; &#39;, and unescaping restores named and numeric entities such as &nbsp; and &#x27;.

Usage example

e.g. Escaping <a href="/?q=1&x=2">link</a> gives &lt;a href=&quot;/?q=1&amp;x=2&quot;&gt;link&lt;/a&gt;, which displays as literal code on a web page.

Things to check

Unescaping converts only entities that end in a semicolon and leaves real tags (such as <b>), spaces, and line breaks untouched, so a form missing its semicolon, like &copy, is left as is. Escaping is for HTML body text and attribute values - values placed inside JavaScript code or URLs need their own encoding.

Related tools

  • Percent-encode text for URLs or decode it back.

    No sign-in neededRuns in your browser

  • Encode text to Base64 or decode Base64 back to text (UTF-8 safe).

    No sign-in neededRuns in your browser

Your input is processed only in this browser and is never sent to a server.