Labs ICT
โญ Pro Login

HTML Entities

What happens when you want to show a less-than sign on your page? If you just type <, the browser thinks it is the start of a tag. That is where HTML entities come in โ€” special codes that let you display reserved characters safely.

Why You Need Entities

HTML reserves certain characters for its own syntax: <, >, &, and ". If you want to display them as text, you have to escape them using entity codes. Otherwise the browser interprets them as part of an HTML tag or attribute.


<p>The &lt;html&gt; tag is the root of every page.</p>
    
Try it Yourself โ†’

Common Entities

Here are the ones you will use most often: &amp; for ampersand, &lt; for less-than, &gt; for greater-than, &quot; for double quote, &nbsp; for a non-breaking space, and &copy; for the copyright symbol.


<p>You &amp; me โ€” always.</p>
<p>Price: $10 &nbsp; &nbsp; In stock</p>
<p>&copy; 2026 My Company</p>
    

Non-Breaking Space

&nbsp; is a space that prevents the browser from breaking the line at that point. Use it when you want two words to stay together โ€” like "10 kg" or "Mr. Smith". Regular spaces can break across lines, but &nbsp; will not.

Numeric Entities

You can also use numeric references like &#169; for copyright or &#8364; for the euro sign. Named entities are easier to remember, but numeric ones work everywhere, including older browsers.

๐Ÿงช Quick Quiz

Which entity represents the less-than sign < ?