• Foundation
  • About 12 min
  • 5 practice questions

Counting and reading numbers in base 2, 8 and 16

Count upwards in binary, octal and hexadecimal, know which digits are allowed in each base and write a number in expanded form.

If something looks wrong, please tell us.

Before converting numbers you need to be comfortable simply counting in other bases. The idea is the same one you already use every day in decimal. Counting in any base follows one rule: when a place runs out of digits, it goes back to 0 and one is carried to the place on its left.

Counting works the same way in every base

In decimal we have ten digits, 0 to 9. After 9 there is no single digit left, so we write 10: a zero in the ones place and a carry of one into the tens place. In binary there are only two digits, 0 and 1, so the carry happens much sooner: after 1 comes 10, then 11, then 100. In octal the digits are 0 to 7, so after 7 comes 10. In hexadecimal the digits are 0 to 9 and then A to F, so after 9 comes A, and after F comes 10.

The first seventeen numbers in four bases
DecimalBinaryOctalHexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

Notice that the written numeral 10 means different amounts in different bases: ten in decimal, two in binary, eight in octal and sixteen in hexadecimal. This is why exam questions always tell you the base, often by a small subscript such as 1011 (base 2) or 375 (base 8).

Which digits are allowed

  • Binary (base 2): only 0 and 1.
  • Octal (base 8): 0 to 7. The digits 8 and 9 never appear.
  • Decimal (base 10): 0 to 9.
  • Hexadecimal (base 16): 0 to 9 and the letters A (ten), B (eleven), C (twelve), D (thirteen), E (fourteen), F (fifteen).

A base always has exactly as many different digits as its value, and the largest digit is one less than the base. This gives a fast validity test: look at the largest digit in the number and make sure it is smaller than the base.

Expanded form

Every number in a positional system can be written as a sum of digit times place value. The place values are powers of the base, starting with the base to the power 0 on the right. In decimal, 245 means 2 × 100 + 4 × 10 + 5 × 1. In octal, the place values from the right are 1, 8, 64, 512 and so on. In hexadecimal they are 1, 16, 256, 4096 and so on.

Worked examples

Example 1. Write the octal number 375 in expanded form and find its decimal value. The place values are 64, 8 and 1, so 375 (base 8) = 3 × 64 + 7 × 8 + 5 × 1 = 192 + 56 + 5 = 253 in decimal.

Example 2. What comes next after each of these? After 1011 in binary: the last two digits are 11, so they reset to 00 and carry, giving 1100. After 77 in octal: both digits are at the maximum 7, so the answer is 100. After 19 in hexadecimal: the last digit 9 is followed by A, giving 1A. After 1F in hexadecimal: F resets to 0 and carries, giving 20.

Example 3. Which of these can be a binary number: 1021, 10110, 1100? The digit 2 is not allowed in binary, so 1021 is invalid. The other two use only 0 and 1 and are valid.

A digit must always be smaller than the base. Counting resets to 0 and carries one to the left.

Key takeaways. Counting in any base is carrying when a place is full. The largest digit is one less than the base. Always check the base before reading what a numeral means, and use the place values 1, 8, 64 for octal and 1, 16, 256 for hexadecimal when expanding.

Check your understanding

  1. 1. What number comes immediately after 1111 in binary?

    1. 10000
    2. 10001
    3. 11110
    4. 11111
    Show answer

    Answer: A. All four digits are at their maximum 1, so each resets to 0 and a carry creates a new place on the left. The answer is 10000, which is 16 in decimal.

  2. 2. Which of the following is a valid octal number?

    1. 508
    2. 1789
    3. 6073
    4. 2890
    Show answer

    Answer: C. Octal allows only digits 0 to 7. 508 contains 8, 1789 contains 8 and 9, and 2890 contains 8 and 9. Only 6073 uses digits no larger than 7.

  3. 3. What is the decimal value of the octal number 375?

    1. 253
    2. 275
    3. 203
    4. 353
    Show answer

    Answer: A. 375 in base 8 = 3 × 64 + 7 × 8 + 5 × 1 = 192 + 56 + 5 = 253.

  4. 4. In hexadecimal, what comes immediately after 2F?

    1. 2G
    2. 30
    3. 3F
    4. 20
    Show answer

    Answer: B. F is the largest hexadecimal digit, so it resets to 0 and carries one into the next place. 2 becomes 3, giving 30.

  5. 5. What does the digit F stand for in hexadecimal?

    1. Sixteen
    2. Twelve
    3. Fifteen
    4. Fourteen
    Show answer

    Answer: C. The letters A, B, C, D, E and F stand for ten, eleven, twelve, thirteen, fourteen and fifteen. So F is fifteen. Sixteen is written 10.

Privacy · Terms · Refunds · Delivery