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 < 10</p>
Browser shows: 5 < 10
Complete Entities Table:
Entity | Shows | When to use |
|---|---|---|
|
| To show less than sign |
|
| To show greater than sign |
|
| To show ampersand |
|
| To show double quote |
|
| To show apostrophe |
| space | Non-breaking space (won't line break) |
| © | Copyright symbol |
| ® | Registered trademark |
| ™ | Trademark symbol |
| € | Euro currency |
| £ | Pound currency |
| ¥ | Yen currency |
| ° | Degree symbol (25°C) |
Examples:
1<p>5 < 10 means 5 is less than 10</p>
2<p>Copyright © 2026 MyCompany</p>
3<p>Today is 25°C outside</p>
4<p>Price: 100 €</p>Output:
5 < 10 means 5 is less than 10
Copyright © 2026 MyCompany
Today is 25°C outside
Price: 100 €
