HTML Escape / Encode

Runs in browser

Escape 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

  1. Choose mode

    Switch between Escape (text → safe HTML) and Unescape (entities → raw text).

  2. Enter input

    Type or paste the text or HTML-escaped string.

  3. Copy result

    Use Copy to copy the escaped or unescaped output.

Common use cases

  • Safely displaying user-generated contentEscape HTML before inserting user input into a web page to prevent XSS vulnerabilities and broken markup.
  • Embedding code samples in HTMLEscape 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
    &lt;div&gt;Hello &amp; &quot;world&quot;&lt;/div&gt;

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: &amp; &lt; &gt; &quot; &#39; (and &apos; when unescaping).

Key concepts

HTML entity
A special sequence starting with & and ending with ; that represents a character in HTML — e.g. &lt; for < and &amp; for &.
XSS (Cross-Site Scripting)
A security vulnerability where attackers inject malicious scripts into web pages by exploiting unescaped user input.

You might find these useful too.

More encoding tools