gg
HomeDev & Data › HTML Encode
Dev & Data

HTML Encode

Escape the characters that break HTML — &, <, > and " — into their entity form so text renders literally instead of as markup.

Try it now

Worked example

&lt;div class=&quot;x&quot;&gt;hi&lt;/div&gt;

Learn the method

Frequently asked

Why escape HTML?

To display code or user text safely without it being parsed as tags.

Which entities?

&amp; &lt; &gt; and &quot;.

Related Dev & Data tools