HTML and XHTML documents use the standard 7-bit ASCII character set in their source. The first 31 characters in ASCII (not listed) are such device controls as backspace () and carriage return ( ) and are not appropriate for use in HTML documents.
HTML 4.01 defines only four entities in this character range: less than (<, <), greater than (<, >), ampersand (&, &), and quotation mark (", "), that are necessary for escaping characters that may be interpreted as markup. XHTML also includes the ' entity that is included in every XML language. In XHTML documents, the ampersand symbol (&) must always be escaped in attribute values. For better compatibility with XML parsers, authors should use numerical character references instead of named character references for all other character entities.
Decimal | Hex | Entity | Symbol | Description |
|---|---|---|---|---|
  |   | Space | ||
! | ! | ! | Exclamation point | |
" | " | " | " | Quotation mark |
# | # | # | Octothorpe | |
$ | $ | $ | Dollar symbol | |
% | % | % | Percent symbol | |
& | & | & | & | Ampersand |
' | ' | XML/XHTML only: ' | ' | Apostrophe (single quote) |
( | ( | ( | Left parenthesis | |
) | ) | ) | Right parenthesis | |
* | * | * | Asterisk | |
+ | + | + | Plus sign | |
, | , | , | Comma | |
- | - | - | Hyphen | |
. | . | . | Period | |
/ | / | / | Slash | |
0- 9 | 0- 9 | 0-9 | Digits 0-9 | |
: | : | : | Colon | |
; | ; | ; | Semicolon | |
< | < | < | < | Less than |
= | = | = | Equals sign | |
> | > | > | > | Greater than |
? | ? | ? | Question mark | |
@ | @ | @ | Commercial at sign | |
A- Z | A- Z | A-Z | Letters A-Z | |
[ | [ | [ | Left square bracket | |
\ | \ | \ | Backslash | |
] | ] | ] | Right square bracket | |
^ | ^ | ^ | Caret | |
_ | _ | _ | Underscore | |
` | ` | ` | Grave accent (no letter) | |
a- z | a- z | a-z | Letters a-z | |
{ | { | { | Left curly brace | |
| | | | | | Vertical bar | |
} | } | } | Right curly brace | |
~ | ~ | ~ | Tilde |