HTML Escape / Unescape
Escape < > & " ' into HTML entities so text displays safely in a web page, or decode entities like & ₹ back to characters — in your browser.
Suggested tools
About HTML Escape / Unescape
HTML Escape converts the five characters that have special meaning in HTML — & < > " ' — into entities (& < > " '). Use it to show code samples on a web page, put user text inside an attribute, or prevent text from being interpreted as tags.
HTML Unescape does the opposite and understands far more than the basics: named entities such as , ©, € and the full Latin-1 set, plus decimal (₹) and hexadecimal (😀) references — including emoji. Everything runs locally in your browser — the text you paste is never uploaded.
How to use HTML Escape / Unescape
- Paste the text or HTML.
- Press Escape to encode special characters, or Unescape to decode entities.
- Copy the result into your page, template or code.
Key features
- Escapes & < > " and ' — safe in text and attributes
- Decodes named, decimal and hex entities
- Emoji and characters beyond the basic plane decode correctly
- Unknown entities are left untouched, never mangled
Example
Special characters become entities, so the text displays instead of being treated as a link.
<a href="/search?q=tea&cup">Tea & "Cups"</a>
<a href="/search?q=tea&cup">Tea & "Cups"</a>
When to use HTML Escape / Unescape
- Showing HTML code on a web page, in a blog post or in documentation.
- Putting user-provided text inside an HTML attribute safely.
- Reading text full of & and ' entities copied from page source or an email.
Tips and common problems
- Escape text exactly once — escaping twice shows "&amp;" on the page.
- Modern templating frameworks escape automatically; escape by hand only when building HTML strings yourself.
- Unescape understands named, decimal and hex entities, including emoji.
Frequently asked questions
Escaping these characters is the core defence for text placed in HTML content and quoted attributes. Text inserted into JavaScript, URLs or CSS needs different escaping, so use your framework's built-in encoding for those contexts.
Only characters that can break HTML need escaping. Modern pages are UTF-8, so letters like é or ગ can be written as they are.
A non-breaking space — it looks like a space but stops a line from breaking at that point. Unescape converts it to the actual non-breaking space character.