https://devtools.solutions/tools/encoding/escape-html.html

Escape HTML

Escape the five HTML special characters (&, <, >, ", ') so they can safely appear in HTML source code.


    

Example input/output

Input: <script>alert("XSS")</script>

Output: &lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;

How it works

This tool replaces &, <, >, ", and ' with their HTML entity equivalents using JavaScript string replacement. The result is safe to embed in HTML attributes or text nodes without causing unintended markup. Processing runs in your browser.

Common use cases

Related tools