Escape HTML Entities
Escape special characters into HTML entities to safely display code or text, or unescape entities back to plain text.
Recommended Settings
Pro Tips
- •Escaping converts &, <, >, ", and ' into their HTML entity equivalents so browsers display them as literal characters instead of interpreting them as markup
- •This is essential when displaying raw HTML or code as visible text on a page, preventing it from being rendered or executed
- •Unescaping reverses named and numeric entities (like & or &) back into their original characters
- •Use the swap button to instantly verify a round-trip by feeding the result back in as input
Most Popular
Most developers escape a code snippet before embedding it inside a <pre> or <code> block so it displays correctly instead of being parsed as HTML
When to Use This Tool
Escape angle brackets and quotes so example code displays correctly instead of rendering as markup.
Safely escape user-generated text before inserting it into an HTML page.
Unescape HTML entities returned by an API or CMS back into plain readable text.
Check whether text is properly escaped when troubleshooting unexpected HTML rendering.
How It Works
For escaping, replace each special character (&, <, >, ", ') with its corresponding named HTML entity
For unescaping, use the browser's own HTML parser to decode named and numeric entities back to their original characters
Display the converted result immediately as you type
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Client-side HTML entity encoding for optimal performance on modern browsers.
Open Source
Built with verified, open-source libraries. Fully transparent.
Frequently Asked Questions
Why escape & first?
The ampersand itself starts every HTML entity, so it must be escaped first to avoid accidentally double-escaping entities that are later created from other characters.
Does unescaping support numeric entities like ©?
Yes, both named entities (&) and numeric entities (& or &) are correctly decoded back to their original characters.
Is this the same as URL encoding?
No, HTML entity escaping is specifically for safely displaying characters within HTML markup, while URL encoding (percent-encoding) is for safely including characters in a URL.
Is my text sent anywhere?
No. All escaping and unescaping happens locally in your browser.