HTML Escape
Interactive StudioEscape or unescape HTML special characters like <, >, &, and quotes. Instant feedback with zero server storage.
Loading tool…
About HTML Escape
HTML reserves a handful of characters for its own syntax — < and > delimit tags, & starts a character entity, and quote marks bound attribute values. When any of these appear in text that's meant to be displayed literally rather than parsed as markup, they have to be replaced with their entity equivalents: & becomes &, < becomes <, > becomes >, " becomes ", and ' becomes '. This tool performs that substitution in either direction — escaping raw text for safe embedding in HTML, or unescaping entities back into their literal characters.
Escaping matters beyond just visual correctness. If user-supplied text is inserted into a page without escaping it first, a string like <script>alert(1)</script> would be parsed as an actual script tag by the browser rather than displayed as text — this is the root mechanism behind cross-site scripting (XSS) vulnerabilities. Escaping the five reserved characters neutralizes that by ensuring the browser renders them as visible text instead of markup.
Common uses include preparing code snippets or user comments for embedding in a web page, decoding entity-laden text copied from a browser's "view source," and cleaning up HTML exported from a CMS or RSS feed before pasting it somewhere else.
How to use HTML Escape
- Choose Escape or Unescape.
- Paste the text or HTML.
- Copy the converted output.
Worked examples
Input: <a href="x">Tom & Jerry</a>
Result: <a href="x">Tom & Jerry</a>
Background
In HTML, < and > start tags, & starts an entity and quotes delimit attribute values. To display these characters literally, they are replaced with entities: <, >, &, ".
Escaping user-provided text before inserting it into a page is the core defense against cross-site scripting (XSS). Escape at output time, in the right context, using your framework's built-in escaping, and do not rely on this tool as a replacement.
Common mistakes
- Escaping twice, which shows &lt; on the page.
- Escaping for HTML text and then using the result inside a JavaScript or URL context, where different rules apply.
- Believing escaping alone makes untrusted HTML safe to render.
Frequently Asked Questions
Frequently Paired With
Fast, local-first developer micro-tools with zero tracking or latency.
