Skip to content

28 tools in stockRuns in your browser

HTML Escape / Unescape

Escape HTML special characters so code displays safely, or turn entities back into text.

Processed locally

Escaping turns < into &lt; so browsers show code instead of running it.

Instructions

How to use it

  1. 01Choose Escape or Unescape.
  2. 02Paste your HTML or text. The result updates instantly.
  3. 03Adjust the options, then copy the output.

About

What it does

In HTML, characters like <, > and & have special meaning. To show them as text (for example, code samples in a blog post), they have to be written as entities: &lt;, &gt;, &amp;.

Escaping also matters for security: inserting unescaped user input into a page is how cross-site scripting (XSS) happens. This tool escapes text for safe display, or turns entity-filled text back into readable characters.

Settings explained

Escape quotes
Converts " and ' too. Required when the text goes inside an HTML attribute value.
Escape non-ASCII
Writes characters like é and emoji as numeric entities (&#233;), useful for systems that mangle UTF-8.
Unescape
Decodes named entities (&copy;), decimal (&#169;) and hex (&#xA9;). Unknown entities are listed and left untouched.

Good for

  • Showing HTML code samples in a blog post or documentation
  • Cleaning up text scraped from a web page full of &amp; and &#39;
  • Preparing strings for HTML attributes and templates
  • Checking how a CMS stored special characters

Questions, answered

Is escaping enough to prevent XSS?
Escaping is the right defence when inserting text into HTML content or quoted attributes. Other contexts (JavaScript, CSS, URLs) need their own escaping, so use a framework that handles context automatically.
What's the difference between &#39; and &apos;?
Both mean an apostrophe. &#39; works everywhere; &apos; isn't defined in older HTML versions, so escaping uses &#39;.
Why are some entities left unchanged?
They're either misspelled or not standard. The tool lists them so you can check rather than silently guessing.