Cat Toolbox
Help CatBlog About Partnership 中文

HTML Escape / Unescape

Escape HTML special characters to entities, or unescape them back. All processing done locally in your browser.

Characters: 0

FAQ

When do I need to escape HTML?
Escaping is needed when displaying code snippets, user input, or special characters in HTML pages. It prevents the browser from interpreting them as HTML tags, avoiding XSS attacks and layout issues. Common scenarios include: blog comment sections showing code, rich text editors, template engine output, etc.

What's the difference between escape and unescape?
Escape converts characters like < > " ' & to their corresponding HTML entity encodings, preventing them from being parsed as tags by the browser. Unescape does the opposite, converting HTML entities back to original characters, suitable for extracting plain text content from HTML source code.

Escape reference table
& → &amp; < → &lt; > → &gt; " → &quot; ' → &#39;

Related guide

JSON, Escape and Markdown Tools: What These Four Pages Do to Your Text Without Asking
All four pages take your text, rewrite it, and never mention it. The JSON formatter turns 1e309 into null and calls that a success; the code generator types every array by its first element, so [1,\"a\"] becomes number[] and duplicate keys become two interfaces with the same name. The HTML escaper knows exactly five characters and double-escapes anything you already escaped. The Markdown preview renders raw HTML, and a single quote in a link URL lets that HTML carry event handlers. Every figure here came from reading these pages' scripts or driving them in a browser.

Advertisement