Skip to content

HTML Escape / Unescape

Escape or unescape HTML entities.

Loading…

About HTML Escape / Unescape

Showing a code sample, a user comment or a snippet full of angle brackets on a web page means turning every character the parser treats as markup into an entity first. Paste the text, keep Escape selected, and the five characters & < > " and ' come out as &amp;, &lt;, &gt;, &quot; and &#39;. Flip to Unescape for the reverse: decimal and hex references plus a built-in list of common names are decoded once, so &amp;lt; becomes &lt; and not <.

Features

  • Escapes ampersands, angle brackets and both quote marks
  • Apostrophes become &#39; and double quotes become &quot;
  • Decodes decimal and hex numeric references
  • Decodes common named entities such as &copy; and &eacute;
  • Decodes one level only, so &amp;lt; becomes &lt;
  • Accented letters and emoji pass through untouched

Limitations

  • Unescape knows numeric references and a built-in list of common names only; any other name is left as written.
  • Escape converts just the five characters above, so non-ASCII characters are never turned into numeric references.
  • Escaping makes text safe to display as text; it does not strip tags or sanitize HTML.

How it works

  1. Paste the text into the HTML Input panel.
  2. Choose Escape to produce entities, or Unescape to decode them, with the toggle in the middle column.
  3. Read the HTML Output panel, which updates as you type.
  4. Select Copy Output to take the result, or Clear All to start again.

Example input

<script>alert("hi")</script> & "quotes" & 'apostrophes'

Frequently asked questions