HTML Escape/Unescape

Use this free online tool to easily escape and unescape HTML. Convert special characters to HTML entities or decode them to plain text.

Escape

Unescape

HTML Escape Tool

HTML escaping is the process of converting special characters into HTML entities. This is important for preventing XSS (Cross-Site Scripting) attacks and ensuring HTML code displays correctly.

Why HTML Escaping?

In HTML, certain characters have special meanings, such as:

  • < and > for tags
  • & for entity references
  • " and ' for attribute values

These characters need to be converted to their corresponding HTML entities if you want to display them as content, otherwise browsers will interpret them as HTML code.

Common HTML Entities

CharacterHTML EntityDescription
<&lt;Less than
>&gt;Greater than
&&amp;Ampersand
"&quot;Double quote
'&apos;Single quote

How to Use

  1. Enter the text you want to escape in the input box
  2. The result will automatically show in the output box below
  3. Click the "Copy" button to copy the escaped text
  4. Unescaping works similarly

Use Cases

  • Displaying code snippets in HTML pages
  • Processing user input to prevent XSS attacks
  • Showing HTML source code in rich text editors