HTML Escape / Encode
Runs in browserEscape and unescape HTML entities instantly in the browser.
Escape and unescape HTML entities instantly in your browser. Convert special characters to HTML-safe format. Free online HTML encoder.
HTML Escape / Encode tool
Files never leave your browser.
Drag and drop a file here, or tap to select
Escaped
<div class="hero">
<h1>Browser & Developer Tools</h1>
<p>Fast, "private" tools for <strong>every</strong> developer.</p>
<a href="https://tooldock.org?ref=hero&utm_source=demo">Try ToolDock →</a>
</div>🔒 Runs in your browser · No uploads · Your data never leaves your device
How to use
Choose mode
Switch between Escape (text → safe HTML) and Unescape (entities → raw text).
Enter input
Type or paste the text or HTML-escaped string.
Copy result
Use Copy to copy the escaped or unescaped output.
Common use cases
- Safely displaying user-generated content — Escape HTML before inserting user input into a web page to prevent XSS vulnerabilities and broken markup.
- Embedding code samples in HTML — Escape code snippets so angle brackets render as text rather than being interpreted as HTML tags.
Examples
Escape
Special chars become entities.
Input<div>Hello & "world"</div>Output<div>Hello & "world"</div>
Frequently asked questions
- Why escape HTML?
- To prevent XSS and to display code or user input safely in HTML.
- Which entities are supported?
- Standard five: & < > " ' (and ' when unescaping).
Key concepts
- HTML entity
- A special sequence starting with & and ending with ; that represents a character in HTML — e.g. < for < and & for &.
- XSS (Cross-Site Scripting)
- A security vulnerability where attackers inject malicious scripts into web pages by exploiting unescaped user input.
Related tools
You might find these useful too.