HTML Escape Tool
Convert special characters between raw HTML and safe display text with escape and unescape support.
What is an HTML escape tool?
An HTML escape tool converts special characters such as less-than, greater-than, ampersand, and quotes into HTML entities. For example, < becomes < so markup can be displayed as text instead of being parsed as HTML. It also supports unescaping to restore entities such as <, >, &, ", and numeric entities, which is useful for code examples, tutorials, comments, templates, and debugging.
How to escape and unescape HTML
- Choose Escape HTML or Unescape HTML, then paste the text into the input box.
- For escaping, choose whether to encode quotes, protect existing entities, and convert non-ASCII characters to numeric entities.
- Click the conversion button to display the result, then copy, download, or swap the input and result.
Main uses of the HTML escape tool
Display code examples
Escaped HTML tags display as ordinary text in the browser, which is useful for tutorials, documentation, Markdown output, and technical blogs.
Display user text safely
Entity text prevents ordinary HTML parsing from treating input as tags. Real applications should still escape for the correct server or frontend context; this tool is not a complete security audit.
Handle existing HTML entities
Protecting existing entities prevents double encoding, such as turning an existing into &nbsp;. Unescape mode helps inspect the character represented by an entity.
Generate numeric entities
When non-ASCII encoding is enabled, non-ASCII characters are written as numeric entities for legacy systems, ASCII-only transfer, or explicit character representation.
HTML escape frequently asked questions
Is HTML escaping the same as URL encoding?
No. HTML escaping is for HTML text or attribute contexts and commonly produces <, >, &, and ". URL encoding is for addresses and query parameters and commonly uses percent encoding. Their rules and contexts differ and they are not interchangeable.
Will unescaping execute a script in the input?
The tool decodes into a textarea and keeps the result as text; it does not insert the result into the page for execution. Do not pass untrusted unescaped output directly to innerHTML or another HTML-parsing API in a real application.
Why protect existing entities?
Without protection, encoding an ampersand turns < into <, which may display the entity source instead of the intended character. Protection suits partially escaped mixed text; disable it only when double encoding is intentional.
Recommended utilities
You may also need these file utilities
HTML Entity Encoder
Convert regular characters into HTML entities and decode entities for symbols and special characters.
HTML to Plain Text
Remove HTML tags and styles to extract only the plain text content from a webpage.
Online HTML Editor
Edit HTML code with live preview, find and replace, copying, and download features.