Valid HTML must be encoded into HTML entities before it can appear in its literal format on a web page. Here is a function written in JavaScript to encode HTML for displaying on a web page or blog. The function converts valid HTML into HTML entities:

Try it here:




Paste HTML Source:

Output with Encoded HTML Entities
Raw Output Preview
" gets encoded into &quot; > gets encoded into &gt; < gets encoded into &lt;

To place HTML or JavaScript code anywhere in a document, it's best to encode into html entities.

Dynamic Page QR Code

Popular Posts

My LinkedIn PingTag


View My Stats