Unsupported input
The tool may reject input that does not match the expected content, structure, or file type.
Fix: Confirm the tool input requirements and paste the correct type of data.
header • up to 320x100 / 728x90
Escape HTML special characters
Output will appear here...
content bottom • up to 300x250
sidebar • 160x600
Last reviewed:
HTML (HyperText Markup Language) is the core markup language for web pages, defining structure and content that browsers render.
HTML Escape replaces reserved HTML characters — &, <, >, ', and " — with their entity equivalents (&, <, >, ', ") so the browser renders the characters as literal text instead of interpreting them as markup.
Escaping is the primary defense against HTML-context injection. Any content that originates from a user, database, or external API and ends up inside an HTML document must be escaped (or handled by a templating engine that escapes by default) to prevent cross-site scripting (XSS).
Start with the HTML input you want to process in HTML Escape.
Get a HTML result from HTML Escape that is ready to review, copy, and reuse in the next step of your workflow.
The tool may reject input that does not match the expected content, structure, or file type.
Fix: Confirm the tool input requirements and paste the correct type of data.
Missing fields or partial content can block processing or produce weak results.
Fix: Provide the full required input before running the tool.
Sample or placeholder values can lead to output that looks valid but is not ready for real use.
Fix: Replace placeholders with your actual values before relying on the result.
For HTML text-context (content between tags), escaping these five characters is the standard defense. For attribute context, JavaScript context, or URL context, different escaping rules apply — see OWASP's XSS Prevention Cheat Sheet. A framework like React, Angular, or Vue handles all contexts automatically; this tool is for one-off escaping outside a framework.
Named entities (&, <) are human-readable and are the idiomatic choice for modern HTML5. Numeric entities (&, <) are functionally identical but more portable — they survive XML pipelines, ASCII-only transport channels, and legacy email systems where named entities may not resolve.
Only if you enable the 'escape non-ASCII' option. By default, non-ASCII characters pass through unchanged because modern UTF-8 HTML documents render them correctly. Enable the option when targeting latin-1 pipelines, legacy CRMs, or ASCII-only transport like some SMTP servers.
No. HTML escaping targets markup-reserved characters inside an HTML document. URL-encoding (percent-encoding) targets reserved characters in a URL (%20 for space, %3F for ?, etc.). Use our URL Encoder for URL contexts; use this tool for HTML contexts.
Use our HTML Unescape tool (the inverse operation), or paste the escaped text into this tool's right pane and click the swap arrow. The reverse conversion decodes both named and numeric entities.
Yes — newlines, tabs, and other whitespace pass through unchanged. Only the five reserved characters (and non-ASCII if enabled) are transformed. Indentation and line breaks are preserved verbatim.
Continue the workflow with related tools for HTML, adjacent input and output steps, or other utilities in the same category. You can also browse the full Escape & Unescape Tools category for more options.
Unescape HTML entities
Escape XML special characters
Escape strings for C#
Escape CSV special characters
Escape strings for Java
Escape JSON special characters
Escape SQL special characters
Encode or decode HTML entities
Encode text to HTML entities
Convert text to HTML entities or decode HTML entities back to text in a single bidirectional tool
View and preview HTML
Escape or unescape C# string literals including \x, \u, and \U Unicode escape sequences