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

HTML Encode

Escape HTML special characters (&, <, >, ", ') to their HTML entity equivalents. Runs in your browser.

Frequently Asked Questions

What can I encode here?

You can HTML-encode text, converting special characters like <, >, and & into their safe HTML entity equivalents.

Can this help with web development?

Yes. It is useful for safely inserting user-supplied text into HTML without risk of injection.

Is encoded data uploaded anywhere?

No. All encoding happens in-browser.

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 the characters &, <, >, ", and ' with their HTML entity equivalents (&amp;, &lt;, &gt;, &quot;, &#39;) using JavaScript string replacement. All processing runs in your browser.

Common use cases

Related tools