HTML Entities

HTML Entities are codes used to show special characters like <, >, and & in HTML safely.

6 views
5 min read
Try It Yourself

Experiment with the code in an interactive editor

What are Entities?

The Problem: HTML uses < and > for tags. What if you want to SHOW <p> on your page?

Example of the problem:

<p>5 < 10</p>

Browser sees < and thinks a new tag is starting. It gets confused.

The Solution: Use entities (special codes)

<p>5 &lt; 10</p>

Browser shows: 5 < 10

Complete Entities Table:

Entity

Shows

When to use

&lt;

<

To show less than sign

&gt;

>

To show greater than sign

&amp;

&

To show ampersand

&quot;

"

To show double quote

&apos;

'

To show apostrophe

&nbsp;

space

Non-breaking space (won't line break)

&copy;

©

Copyright symbol

&reg;

®

Registered trademark

&trade;

Trademark symbol

&euro;

Euro currency

&pound;

£

Pound currency

&yen;

¥

Yen currency

&deg;

°

Degree symbol (25°C)

Examples:

1<p>5 &lt; 10 means 5 is less than 10</p>
2<p>Copyright &copy; 2026 MyCompany</p>
3<p>Today is 25&deg;C outside</p>
4<p>Price: 100 &euro;</p>

Output:

  • 5 < 10 means 5 is less than 10

  • Copyright © 2026 MyCompany

  • Today is 25°C outside

  • Price: 100 €