JSONHack
Validator · Formatter · Base64
HTML Tool

HTML Escape / Unescape

Convert HTML special characters like <, >, &, and " to their HTML entity equivalents, or decode HTML entities back to plain text. Essential for safely displaying user-generated content in web pages and preventing XSS attacks.

Input
Paste HTML to escape, or HTML entities to unescape
Output

Common HTML Entities Reference

CharEntity NameEntity NumberDescription
&&amp;&#38;Ampersand — must always be escaped in HTML
<&lt;&#60;Less than — starts HTML tags
>&gt;&#62;Greater than — ends HTML tags
"&quot;&#34;Double quote — used in attribute values
'&apos;&#39;Single quote / apostrophe
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright symbol
®&reg;&#174;Registered trademark
&trade;&#8482;Trademark symbol
&mdash;&#8212;Em dash

Why HTML Escaping Matters

HTML escaping is a critical security practice. When you display user-generated content in a web page without escaping it, attackers can inject malicious HTML or JavaScript — a vulnerability known as Cross-Site Scripting (XSS). For example, if a user submits <script>alert('hacked')</script> as their name and you display it unescaped, the script will execute in every visitor's browser.

When to Escape HTML

HTML Escape vs URL Encode vs JSON Escape

Need to escape JSON strings too?

Use the JSON Escape tool to safely embed strings inside JSON documents.

Open JSON Escape →