Special character reference page

What can you do if you wish to use a character that does not appear on your keyboard in an HTML page? Or how can you use a character like < which is part of an HTML tag? You can use character entities like those illustrated below.

Note that character entity names begin with an ampersand (&) and end with a semicolon (;). They have the general form &<name>;. For example, to render an n with a tilde (ñ), use &ntilde;. Alphabetic symbols often have case sensitive names, so, for example an N with a tilde (Ñ) would be &Ntilde;.

You can use hex or decimal numbers as well as the special names for the characters. When you use the numbers, they refer to Unicode characters.

It is a good idea to check to see whether character entities are render correctly in each browser your users may have. For example, in the table below each rendering should be identical for a given character.

The following table shows a few examples. It was taken from a more extensive reference.

Character Entity Decimal Hex Rendering in Your Browser
Entity Decimal Hex
less-than sign &lt; &#60; &#x3C; < < <
greater-than sign &gt; &#62; &#x3E; > > >
leftwards arrow &larr; &#8592; &#x2190;
upwards arrow &uarr; &#8593; &#x2191;
rightwards arrow &rarr; &#8594; &#x2192;
downwards arrow &darr; &#8595; &#x2193;
left right arrow &harr; &#8596; &#x2194;
inverted question mark &iquest; &#191; &#xBF; ¿ ¿ ¿
inverted exclamation point &iexcl; &#161; &#xA1; ¡ ¡ ¡
Latin small letter o with grave &ograve; &#242; &#xF2; ò ò ò
Latin small letter o with acute &oacute; &#243; &#xF3; ó ó ó
Latin small letter o with circumflex &ocirc; &#244; &#xF4; ô ô ô
Latin small letter o with tilde &otilde; &#245; &#xF5; õ õ õ
Latin small letter o with diaeresis &ouml; &#246; &#xF6; ö ö ö
Latin capital letter O with grave &Ograve; &#210; &#xD2; Ò Ò Ò
Latin capital letter O with acute &Oacute; &#211; &#xD3; Ó Ó Ó
Latin capital letter O with circumflex &Ocirc; &#212; &#xD4; Ô Ô Ô
Latin capital letter O with tilde &Otilde; &#213; &#xD5; Õ Õ Õ
Latin capital letter O with diaeresis &Ouml; &#214; &#xD6; Ö Ö Ö
Greek small letter mu &mu; &#956; &#x3BC; μ μ μ
Greek small letter pi &pi; &#960; &#x3C0; π π π
Greek capital letter mu &Mu; &#924; &#x39C; Μ Μ Μ
Greek capital letter pi &Pi; &#928; &#x3A0; Π Π Π


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.