HTML Escape & Unescape

Escape reserved HTML characters into named, decimal, or hex character references, or unescape entity-encoded strings back to plain text.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
Plain HTML / Text input
0 lines · 0 charsUTF-8
Escaped output
0 lines · 0 chars

About This Tool

Converts reserved HTML characters (&, <, >, ", ') into safe HTML character references or decodes existing named, decimal, and hexadecimal entities back into plain text.

Toggle Attribute mode when escaping text destined for HTML attribute values so double and single quotes are encoded alongside angle brackets and ampersands.

Key Features

  • Bidirectional conversion: Switch between Escape (plain text to entities) and Unescape (entities to plain text) with one click or the swap button.
  • Named, decimal, and hex formats: Choose named references (&amp;, &lt;, &euro;), decimal numeric (&#38;), or hexadecimal numeric (&#x26;) output.
  • Attribute mode toggle: Include or skip quote escaping (" and ') depending on whether output goes inside an attribute or element body.
  • Non-ASCII encoding: Optionally convert characters above ASCII 127 (such as currency symbols and typographic marks) into entities.

Frequently Asked Questions

When should Attribute mode be enabled?
Keep Attribute mode enabled whenever the escaped string will be placed inside an HTML attribute like title="..." or value='...'. Without quote escaping, a quote character inside the value can break out of the attribute boundary.
Why does named mode encode a single quote as &#39; instead of &apos;?
While &apos; is valid in HTML5 and XML, &#39; works across legacy HTML4 parsers as well as modern browsers. Unescape mode decodes both &#39; and &apos; back to a single quote.
What happens to unknown or malformed entities during unescaping?
Unrecognized entity names (like &customThing;) and out-of-range numeric code points (like surrogate halves or values above U+10FFFF) are left untouched so surrounding text is not corrupted.
Is my HTML snippet sent to a server?
No. Escaping and unescaping happen in your browser tab with zero network requests.