HTML Character Entities
Reserved characters in HTML must be replaced with character entities.
Some characters that cannot be found on the keyboard can also be replaced with character entities.
HTML Entities
In HTML, certain characters are reserved.
In HTML, you cannot use the less-than sign (<) and the greater-than sign (>), because the browser may mistake them for tags.
If you want to display reserved characters correctly, you must use character entities in the HTML source code. A character entity looks like this:
&
entity_name
;
or
entity_number
;
To display a less-than sign, we must write:< or ** <** or <
Tip: The advantage of using entity names instead of numbers is that names are easy to remember. The disadvantage is that browsers may not support all entity names (support for entity numbers is quite good).
Non-breaking Space (Non-breaking Space)
A commonly used character entity in HTML is the non-breaking space ( ).
Browsers always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will remove 9 of them before displaying the page. To increase the number of spaces on a page, you need to use the character entity.
Combining Diacritical Marks
A diacritical mark is a "glyph" (character shape) added to a letter.
Some diacritical marks, such as the acute accent ( ̀) and the grave accent ( ́).
Diacritical marks can appear above and below a letter, inside a letter, or between two letters.
Diacritical marks can be used in combination with letters and numeric characters.
Here are some examples:
| Diacritical mark | Character | Construct | Output result |
|---|---|---|---|
| ̀ | a | à | à |
| ́ | a | á | á |
| ̂ | a | â | â |
| ̃ | a | ã | ã |
| ̀ | O | Ò | Ò |
| ́ | O | Ó | Ó |
| ̂ | O | Ô | Ô |
| ̃ | O | Õ | Õ |
HTML character entity
![]() |
Entity names are case-sensitive! |
|---|
| Display Results | Description | Entity Name | Entity Number |
|---|---|---|---|
| Space | |||
| < | Less-than sign | < | < |
| > | Greater-than sign | > | > |
| & | Ampersand | & | & |
| " | Quotation mark | " | " |
| ' | Apostrophe | ' (not supported by IE) | ' |
| ¢ | Divide | ¢ | ¢ |
| £ | Pound | £ | £ |
| ¥ | Renminbi/Yen | ¥ | ¥ |
| € | Euro | € | € |
| § | Section | § | § |
| © | Copyright | © | © |
| ® | Registered trademark | ® | ® |
| ™ | Trademark | ™ | ™ |
| × | Multiplication | × | × |
| ÷ | Division | ÷ | ÷ |
Although html is case-insensitive, entity characters are case-sensitive.
To view the complete list of HTML entities on this site, please click HTML Entity Reference Manual。
