Display HTML Tags and Code as Text

To show HTML source code as text, escape characters that would otherwise be parsed as markup. The most important are < as &lt;, > as &gt;, and & as &amp;.

&lt;a href=&quot;https://www.plus2net.com/&quot;&gt;HTML Tutorials&lt;/a&gt;

Why escaping is required Top ↑

If you place literal <h1> in an HTML document, the browser treats it as an element. To teach or display the markup itself, write the encoded characters or generate the escaped text on the server.

HTML code display converter Top ↑

Paste HTML below. The result is escaped for safe display inside a page. Line breaks are preserved by the <pre> element, so no extra <br> conversion is required.

Escaping in PHP Top ↑

For dynamic text, PHP's htmlspecialchars() is normally the right tool when outputting user-controlled text into HTML.

<?php
echo htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
?>

HTML to PHP converter PHP converter demo





plus2net.com







smo1234

19-03-2012

good script, I am using this regularly
Sam

10-03-2013

"Great Code" to make a website with HTML tutorials like this website
marv

27-09-2013

thanks, it works very well and is a nice timesaver for displaying snippets online
Jay

04-10-2013

Very helpful, thanks.
Mayesh

22-11-2013

It is very useful
Thankq plus2net
Connie

10-09-2014

Thank you so much. What a time saver!
Shiju

30-09-2014

This is really good..Thanks..!
Andy

14-11-2014

Very useful tutorial. Saved so much time. Thanks...!
Rajesh

29-04-2015

Awesome tool .... Saved so much time ... Thanks !!!!



✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer