Small Tools
Encoding utility

HTML Escape / Unescape

Escape or decode HTML special characters in text.

● This tool runs entirely in your browser. Your input is never uploaded to our servers.
Output
Your result will appear here…

How to use HTML Escape / Unescape

  1. Choose Escape to encode markup or Unescape to decode it.
  2. Paste the markup, or the text that contains character references.
  3. Run the conversion and copy the output.

Example

Input / settings:

<button title="Hello">Tom & Jerry</button>

Output:

&lt;button title=&quot;Hello&quot;&gt;Tom &amp; Jerry&lt;/button&gt;

The apostrophe is written as &#39;. Unescape turns this exact output back into the original text.

When to use

Overview

HTML Escape replaces the five characters that have special meaning in HTML text — &, <, >, " and ' — with character references so the text is displayed literally. Unescape reverses exactly those five references and nothing else. Other characters, including accented letters and symbols, are left unchanged.

Supported input

Any text to escape, or text containing &amp;, &lt;, &gt;, &quot; and &#39; references to unescape.

Output details

Text with &, <, >, double quotes and single quotes replaced by character references, or the decoded text.

Common mistakes

Practical tips

Privacy and security

This tool runs entirely in your browser. Your input is never uploaded to our servers. Escaping runs locally. It is output encoding, not a sanitizer: it does not remove or validate markup, and it does not make untrusted data safe inside a script, style or URL context.

References

Frequently asked questions

Which characters does HTML Escape change?

Only &, <, >, double quotes and single quotes. The single quote becomes &#39;.

Does Unescape decode every named entity?

No. It decodes the five references that Escape produces. Others, such as &nbsp; or &copy;, are left as they are.

Is HTML escaping the same as sanitizing HTML?

No. Escaping makes markup display as text. Sanitizing removes or rewrites unwanted markup, which this tool does not do.

Related tools