Some characters are reserved in HTML — for example, < and > are used for tags. To display these characters as text, you must use HTML entities.
An HTML entity is a piece of text that starts with & and ends with ;. It represents a character that either:
<, >, &)Entities can be written as a named entity or a numeric entity:
&entity_name; <!-- Named entity -->
&#entity_number; <!-- Numeric (decimal) entity -->
&#xhex_number; <!-- Numeric (hex) entity -->
Example — displaying the less-than sign <:
< <!-- Named entity -->
< <!-- Numeric (decimal) -->
< <!-- Numeric (hex) -->
These characters must be replaced with entities when used as content in HTML:
| Character | Description | Entity Name | Entity Number |
|---|---|---|---|
| < | Less than | < | < |
| > | Greater than | > | > |
| & | Ampersand | & | & |
| " | Double quote | " | " |
| ' | Single quote / apostrophe | ' | ' |
< directly inside your HTML content without using <, the browser may think it's the start of a tag and break your page layout.
The most commonly used entity is the non-breaking space . It adds a space that will not collapse or line-break:
<p>10 km</p>
<p>Hello World</p>
10 km
Hello World
| Character | Description | Entity Name | Entity Number |
|---|---|---|---|
| Non-breaking space | |   | |
| © | Copyright | © | © |
| ® | Registered trademark | ® | ® |
| ™ | Trademark | ™ | ™ |
| € | Euro sign | € | € |
| £ | Pound sign | £ | £ |
| ¥ | Yen sign | ¥ | ¥ |
| ¢ | Cent sign | ¢ | ¢ |
| — | Em dash | — | — |
| – | En dash | – | – |
| « | Left angle quotes | « | « |
| » | Right angle quotes | » | » |
| ♥ | Heart | — | ♥ |
| ★ | Star | — | ★ |
Entities can be combined with regular text and other HTML tags:
<p>© 2025 RedoHub. All rights reserved.</p>
<p>Price: €29.99</p>
<p>5 < 10 and 10 > 5</p>
© 2025 RedoHub. All rights reserved.
Price: €29.99
5 < 10 and 10 > 5
© are easier to remember. Numeric entities like © always work even in older browsers that may not recognise all named entities.