Have you ever wondered how you can display special characters such as the copyright sign © that are not found on the keyboard? The answer is HTML entities!
Entities are simply a unique code that represents a symbol. They're formed by either writing &name; or &#number;. For example the copyright sign can be written as either © or ©.
A common use of HTML entities is to add multiple spaces because by default HTML ignores more than one space entered with the spacebar. To add as much space as you want you can use the so-called non-breaking space entity .
Another important use of HTML entities is to display HTML code as normal text. If you just type the HTML code as usual it will simply render as HTML because the < and > characters are reserved for HTML tags. The solution is to replace them with their entities < and >.
Here's a list of often used HTML entities:
| Entity name | Entity number | Symbol | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than |
| > | > | > | Greater than |
| " | " | " | Double quote |
| ‹ | ‹ | ‹ | Single left angle quote |
| › | › | › | Single right angle quote |
| « | « | « | Double left angle quote |
| » | » | » | Double right angle quote |
| |   | Non-breaking space | |
| © | © | © | Copyright |
| ® | ® | ® | Registered trademark |
| ™ | ™ | ™ | Trademark |
| ‰ | ‰ | ‰ | Permil |
| € | € | € | Euro |
| ↑ | ↑ | ↑ | Single up arrow |
| ⇑ | ⇑ | ⇑ | Double up arrow |
| ↓ | ↓ | ↓ | Single down arrow |
| ⇓ | ⇓ | ⇓ | Double down arrow |
| ← | ← | ← | Single left arrow |
| ⇐ | ⇐ | ⇐ | Double left arrow |
| → | → | → | Single right arrow |
| ⇒ | ⇒ | ⇒ | Double right arrow |
| ♥ | ♥ | ♥ | Heart |