Menu

Character Sets

ASCII Character Codes

ASCII codes are numbers that stand for characters. The ASCII table puts letters and digits in blocks, so once you know one code you can work out others in the same block by counting.

Separate cases, consecutive letters

Uppercase and lowercase versions of a letter have different ASCII codes. For example, B has code 66 and b has code 98. The uppercase letters form one unbroken block, and the lowercase letters form another block later in the table. Within each case, letters are in alphabetical order and their codes are consecutive: W is 87, X is 88 and Y is 89. Do not count from an uppercase letter to a lowercase letter as if they were next to each other.

ASCII codes in three blocks: digits 48 to 57, uppercase letters 65 to 90 and lowercase letters 97 to 122, with gaps between them. 5 is 53, B is 66 and b is 98.

Digits and counting

The digit characters 0 to 9 are also consecutive. For example, 4 is 52, so 5 is 53 and 6 is 54. Because each block sits in order, you can find a code by counting forward or backward from a code you know. If q is 113, count forward three places: r is 114, s is 115 and t is 116. Count backward two places from q and o is 111.

Binary, denary and hexadecimal

Inside the computer an ASCII code is stored as a binary pattern. It is often written as a denary number because that is easier to read, and it can also be written in hexadecimal. These are three ways of writing the same code:

CharacterDenaryBinaryHexadecimal
B66100001042
b98110001062
553011010135

Practise this