Escape / Unescape
HTML Escape / Unescape
Convert text to safe HTML entities and back — <, >, & and quotes handled, named and numeric entities decoded.
In short
Escape and unescape HTML online: convert <, >, &, and quotes to entities and back. Prevent broken markup and XSS when embedding text in pages. Free.
By NaveenKumar T · Updated
Learn: HTML Entities Explained: When to Escape &, <, > and Quotes
- Escape & unescape in one tool
- Handles every special character
- Instant as you switch modes
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
HTML Escape: input and output
Escaping a code snippet so a tutorial page shows it literally instead of executing it.
<button onclick="save()">Save & exit</button>
if (x < 10 && y > 2) alert('Zoë says "hi"');
Prix : 12 € — c'est déjà réservé<button onclick="save()">Save & exit</button>
if (x < 10 && y > 2) alert('Zoë says "hi"');
Prix : 12 € — c'est déjà réservéOnly the five special characters changed — the accented letters, the euro sign and the line breaks come through untouched, and each apostrophe became ' rather than '.
Learn more
HTML escaping rules
Five characters are dangerous in HTML: < and > open and close tags, & starts entities, and both quote styles can end attribute values. Escaping converts them to entities — <, >, &, ", ' — so the browser renders your text literally instead of parsing it as markup. This is also the first line of defense against XSS: user content embedded without escaping is an injection waiting to happen.
Unescaping reverses the process and is more involved than it looks: this tool decodes the named entities you'll meet in real pages ( , ©, —, … and friends) plus every numeric form (' and '), turning scraped or exported HTML back into clean text.
Help
Frequently asked questions
Everything you need to know about the HTML Escape.
01How do I escape or unescape HTML here?
Paste your text, pick Escape or Unescape in the Mode select, and press Convert. Escape converts the five HTML-unsafe characters to entities; Unescape decodes named entities like and © plus numeric references back to plain text.
02Should I escape user input with this before putting it in a page?
For quick jobs and debugging, yes — this implements the standard five-character escape. In application code, use your framework's built-in escaping (it runs automatically in React, Vue, and most template engines) so the protection can't be forgotten on one code path.
03Why is the apostrophe escaped as ' instead of '?
' was defined for XML and only joined HTML in HTML5, so old browsers and some email clients print it literally; the numeric ' has always worked everywhere, which is why Escape mode emits it. Nothing else is touched: accented letters, emoji and line breaks pass through unchanged, since a UTF-8 page renders them directly. Unescape accepts both forms — plus decimal and hex references and the common named entities — and turns into an ordinary space.
Keep working
Related tools
XML Escape
Escape / Unescape
JavaScript Escape
Escape / Unescape
JSON Escape
Escape / Unescape
HTML Formatter
Prettier-quality HTML formatting — embedded CSS and JavaScript formatted too, with a live preview one click away.
HTML to Markdown
Turn CMS exports, documentation pages and pasted markup into clean Markdown — wrappers and inline styling dropped, tables and code blocks kept.
Markdown to HTML
Paste Markdown, get the HTML a Markdown renderer would produce — GitHub Flavored tables, task lists, fenced code and strikethrough included.
Learn the format
Related guides
HTML Entities Explained: When to Escape &, <, > and Quotes
Which characters to escape in HTML text, attributes, URLs and scripts, how named, decimal and hex references differ, and why you keep seeing &amp;.
9 min readGuide · Developer ToolsFreeFormatter Alternatives (2026): Where Its Tools Went
FreeFormatter.com has been retired and its tool pages now return 404. A verified map of where each formatter, validator, escaper and encoder moved.
6 min readGuide · Data FormatsHow to Convert Excel to JSON (Without Writing Code)
Turn Excel or Google Sheets data into clean JSON in under a minute: paste cells directly or export CSV — with typed numbers, booleans, and proper quoting.
2 min read