• Practice
  • About 14 min
  • 5 practice questions

Binary and decimal conversion

Convert between binary and decimal quickly using place values and repeated division.

If something looks wrong, please tell us.

Computers store everything with two digits, 0 and 1. This is the binary system, with base 2. Conversion between binary and decimal is the most common number system question, and it becomes routine once you know the place values.

Place values

In binary, the place values from the right are 1, 2, 4, 8, 16, 32, 64, 128 and so on: powers of 2.

Powers of 2
Position76543210
Value1286432168421

Binary to decimal

Add the place values wherever there is a 1.

Example 1. Convert 10110 to decimal. Place values from the right: 1, 2, 4, 8, 16. The digits 1 0 1 1 0 give 16 + 0 + 4 + 2 + 0 = 22.

Decimal to binary

Divide repeatedly by 2 and note the remainders. Read the remainders from bottom to top.

Example 2. Convert 45 to binary. 45 / 2 = 22 remainder 1. 22 / 2 = 11 remainder 0. 11 / 2 = 5 remainder 1. 5 / 2 = 2 remainder 1. 2 / 2 = 1 remainder 0. 1 / 2 = 0 remainder 1. Reading upwards: 101101. Check: 32 + 8 + 4 + 1 = 45.

Binary to decimal: add the place values of the 1s. Decimal to binary: divide by 2 and read the remainders upwards.

— Method to remember

Key takeaways: learn the powers of 2 up to 128 and always check your answer by converting back.

Check your understanding

  1. 1. Convert binary 11010 to decimal.

    1. 26
    2. 22
    3. 13
    4. 25
    Show answer

    Answer: A. Place values 16, 8, 4, 2, 1 with digits 1, 1, 0, 1, 0: 16 + 8 + 2 = 26.

  2. 2. Convert decimal 77 to binary.

    1. 1011001
    2. 1001101
    3. 1001011
    4. 1000111
    Show answer

    Answer: B. 77 / 2 = 38 r1, 38 / 2 = 19 r0, 19 / 2 = 9 r1, 9 / 2 = 4 r1, 4 / 2 = 2 r0, 2 / 2 = 1 r0, 1 / 2 = 0 r1. Upward: 1001101. Check: 64 + 8 + 4 + 1 = 77.

  3. 3. What is binary 11111111 in decimal?

    1. 256
    2. 127
    3. 255
    4. 511
    Show answer

    Answer: C. 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.

  4. 4. Counting positions from 0 at the right, what is the place value of position 6 in binary?

    1. 6
    2. 32
    3. 128
    4. 64
    Show answer

    Answer: D. Position n is worth 2^n, and 2^6 = 64.

  5. 5. Convert binary 1000000 to decimal.

    1. 64
    2. 32
    3. 128
    4. 7
    Show answer

    Answer: A. The only 1 is in the seventh place from the right, which is worth 2^6 = 64.

Sign in to keep track of the lessons you finish.

Next lesson → Octal and hexadecimal systems

Privacy · Terms · Refunds · Delivery