HTML Entities

Reserved characters in HTML must be replaced with character entities.

Some characters not found on the keyboard can also be replaced using character entities.

HTML special characters are characters that must be represented by entities, because the characters themselves have a special meaning to HTML, even when they appear in text. These are only the characters “, ‘, <, >, and &.

HTML entities

In HTML, certain characters are reserved.

Less-than (<) and greater-than (>) signs cannot be used in HTML because browsers mistake them for tags.

If we want to display reserved characters correctly, we must use character entities in the HTML source code. Character entities look like this:


To show the less than sign, we must write: < or < or <

RemarkTip: The advantage of using entity names instead of numbers is that the names are easier to remember. The downside, though, is that browsers may not support all entity names (it does support entity numbers well).

Non-breaking Space

A common character entity in HTML is the nonbreaking space ( ).

Browsers always truncate spaces in HTML pages. If you write 10 spaces in the text, the browser removes 9 of them before displaying the page. To increase the number of spaces in a page, you need to use the character entity.

Combine phonetic symbols

A diacritic is a “glyph” added to a letter.

Some diacritics, such as acute ( ̀) and grave ( ́) .

Diacritics can appear above and below a letter, within a letter, or between two letters.

Diacritics can be used in combination with alphanumeric characters.

Here are some examples:

phonetic symbolCharacterConstructResult

HTML character entities

lampEntity names are case sensitive!
Show resultsdescribeentity nameentity number
<Less than sign<<
>greater than sign>>
quotation marks
apostrophe ‘ (not supported by IE)
×Multiplication sign××
÷division sign÷÷

While html is not case sensitive, entity characters are case sensitive.

To view the complete HTML entities on this site: please click on the HTML Entities Reference Manual .