Developer Playground
HTML Escape / Unescape
Escape or unescape HTML entities in your text
Output
Result will appear here...About HTML Escape/Unescape
This tool helps you escape special HTML characters to their corresponding HTML entities or unescape HTML entities back to their original characters.
Examples:
<div>becomes<div>(escaped)<div>becomes<div>(unescaped)"Hello"becomes"Hello"(escaped)
Why Escape HTML?
HTML escaping is a critical security measure used to prevent Cross-Site Scripting (XSS) attacks. By converting special characters (like <, >, &, ", and ') into HTML entities, you ensure that web browsers treat user input as safe text rather than executable code or HTML markup.
When to Unescape HTML?
You might encounter text that has been heavily escaped (e.g., in database exports, JSON API responses, or legacy systems). Unescaping HTML converts entities like < back to their original characters (<), making the text readable and usable for further processing.
How to use this tool
Enter your raw HTML or text into the Input area. Click Escape HTML to safely encode characters for web display. Click Unescape HTML to decode previously escaped text back to its original form. You can also use the Load Test Example button to see how it works instantly.