What is HTML Escape Unescape?
HTML Escape Unescape — An HTML Escape Tool is a free tool that converts special characters (<, >, &, ", ') into HTML entities and decodes HTML entities back to their original characters.
Loading your tools...
Convert special HTML characters like <, >, &, double quotes, and apostrophes to safe HTML entities (< > &) for XSS prevention and code display — or decode HTML entities back to readable plain text for content migration and template debugging.
HTML Escape Unescape: Paste text containing HTML special characters to escape them into safe entity codes (< > &), or paste escaped HTML to decode it back to readable characters. Essential for displaying code snippets in web pages.
Loading Tool...
HTML Escape Unescape — An HTML Escape Tool is a free tool that converts special characters (<, >, &, ", ') into HTML entities and decodes HTML entities back to their original characters.
Paste raw HTML, code snippets, or user-generated content into the Escape panel to convert all special characters (<, >, &, quotes) into safe HTML entities.
Paste entity-encoded strings from APIs, databases, or email templates into the Unescape panel to decode them back into readable plain text.
Review the converted output to verify all angle brackets, ampersands, and quotation marks are properly encoded or decoded.
Copy the result with one click for use in HTML templates, CMS content fields, blog posts, or application code.
Preventing XSS attacks by escaping user-generated content before rendering in HTML pages and web applications
Displaying code snippets with angle brackets and ampersands safely inside blog posts, tutorials, and documentation
Decoding HTML entities from API responses, database exports, and RSS feeds during content migration workflows
Debugging double-encoding issues (&lt;) in CMS templates, email HTML, and server-rendered markup
Preparing escaped HTML strings for embedding in JSON payloads, XML feeds, and JavaScript template literals
HTML escaping (also called HTML encoding or entity encoding) is a critical web security practice that converts characters with special meaning in HTML markup into their entity representations. The five core characters that must be escaped are: less-than (< to <), greater-than (> to >), ampersand (& to &), double quote (" to "), and single quote/apostrophe (' to '). Without proper escaping, user-submitted content containing these characters can be interpreted as HTML tags or JavaScript, creating cross-site scripting (XSS) vulnerabilities — one of the OWASP Top 10 security risks.
HTML unescaping (decoding) reverses the process, converting entity-encoded strings back to their original characters. This is essential when processing content from APIs that return HTML-encoded data, migrating content between CMS platforms, parsing RSS/Atom feeds, or debugging rendering issues where entities appear as literal text (e.g., users see & instead of &). Modern frameworks like React, Angular, and Vue auto-escape by default, but understanding manual escaping remains crucial for raw HTML output, dangerouslySetInnerHTML contexts, server-side rendering, and email template development.
Most workflows at minimum escape `<`, `>`, `&`, double quotes, and apostrophes. Depending on context, additional characters may also be encoded using numeric entities.
If rendering still looks wrong after escaping, inspect whether content was escaped twice. Double-escaped text often appears with `&lt;` patterns.
Convert special characters to HTML entities and decode entities back to readable text.