Character Codes

Escape codes always start with an ampersand (&) character followed by the individual code and finished with a semicolon (;).

All characters have a numerical, decimal-based (in addition to hexadecimal), value. In HTML, prepend decimal this value with the ampersand identifier as well as a number sign (&#).

Using escape character codes in HTML text is straightforward. Simply replace the character you want with its escape code equivalent in the text.

For example, we could write the word “CAT” by wrapping the individual letters’ decimal values (67, 65, and 84) in the escape code values: