Look up any character’s decimal, hexadecimal, octal, binary and HTML / URL encoding.
| Char | Dec | Hex | Oct | Bin | HTML entity | URL encode |
|---|
ASCII — the American Standard Code for Information Interchange — was published in 1963 to give every character a number that all computers agree on. It defines 128 code points in total and fits in 7 bits, which is why it is often called a 7-bit encoding even though it is nearly always stored in an 8-bit byte.
| Code range | What lives there |
|---|---|
| 0 – 31 | Control characters — NUL, TAB (9), LF (10), CR (13), ESC (27) |
| 32 | Space |
| 33 – 47 | Punctuation: !"#$%&'()*+,-./ |
| 48 – 57 | Digits 0 – 9 |
| 65 – 90 | Uppercase A – Z |
| 97 – 122 | Lowercase a – z |
| 127 | DEL — the last of the original set |
One consequence is useful in code: uppercase and lowercase letters differ by exactly 32. 'a' − 'A' = 32, so flipping the case of a letter is a single XOR.
Anything beyond the Latin alphabet — accents, Cyrillic, Chinese, emoji — lives outside ASCII. Two extensions became widespread: Latin-1 (also called ISO-8859-1), which uses codes 128–255 for Western European characters, and Windows-1252, which filled the same range with slightly different symbols. The web standardised on UTF-8 instead, which keeps ASCII's 0–127 unchanged and encodes everything else in multi-byte sequences. That backwards compatibility is why UTF-8 could replace ASCII without breaking existing documents.
\n, \t, \r and \0 are direct references to ASCII control codes.Keep in mind that "ASCII" is sometimes used loosely to mean "plain text" or "7-bit safe". If you need to know whether an accented letter or an emoji fits, the answer is no — you need Unicode.