Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Binary numbers: how computers count

Computers use only 0 and 1. Learn place values 1, 2, 4, 8, 16 and how to change numbers to binary and back.

Get the whole book: Computers and coding for classes 6 to 8 (8 lessons, free to print)

Let us begin

The big idea

We count with ten digits, 0 to 9. A computer only has two: 0 and 1. This way of counting is called binary. With just 0s and 1s a computer can show numbers, words, pictures and music.

Inside a computer, tiny switches are either off or on. Off is written 0 and on is written 1. Each 0 or 1 is called a bit.

In our usual numbers, the places are 1, 10, 100 and so on, each ten times bigger. In binary, each place is two times bigger. From the right, the place values are 1, 2, 4, 8, 16, and so on.

To read a binary number, add the place values that have a 1. For 1011: 8 + 0 + 2 + 1 = 11.

To write a number in binary, find the biggest place value that fits, take it away, and carry on with what is left. Put 1 in every place value you used and 0 in the rest.

Eight bits together are called a byte.

The number 13 in binaryA table with four boxes in the top row showing place values 8, 4, 2 and 1, and four boxes below showing the bits 1, 1, 0 and 1. Beneath it, a line says 8 plus 4 plus 0 plus 1 equals 13.The number 13 in binary Value 8 4 2 1 Bit 1 1 0 1 8 + 4 + 0 + 1 = 13 So 1101 in binary is 13
Add the place values that have a 1.

Worked examples

See how it works

  1. Binary to usual number: 1011

    Place values from the right are 1, 2, 4, 8. So 1011 has: 1 x 8 + 0 x 4 + 1 x 2 + 1 x 1 = 8 + 0 + 2 + 1 = 11.

  2. Usual number to binary: 13

    13 - 8 = 5, so use 8. 5 - 4 = 1, so use 4. 2 does not fit in 1, so skip 2. 1 - 1 = 0, so use 1. The places 8, 4, 2, 1 get 1, 1, 0, 1. So 13 is 1101. Check: 8 + 4 + 0 + 1 = 13.

  3. A five-bit number: 10010

    Place values from the right: 1, 2, 4, 8, 16. The digits are 1, 0, 0, 1, 0 from the left, so 1 x 16 + 0 x 8 + 0 x 4 + 1 x 2 + 0 x 1 = 16 + 2 = 18.

  4. Usual number to binary: 25

    25 - 16 = 9, so use 16. 9 - 8 = 1, so use 8. 4 does not fit in 1, 2 does not fit in 1. 1 - 1 = 0, so use 1. The places 16, 8, 4, 2, 1 get 1, 1, 0, 0, 1. So 25 is 11001. Check: 16 + 8 + 1 = 25.

Try it at home

Binary cards

You will need

  • 4 small pieces of paper or card
  • pencil

What to do

  1. Draw dots on each card: 1 dot, 2 dots, 4 dots and 8 dots.
  2. Put the cards in a row with the 8 on the left and the 1 on the right.
  3. Turn a card face up for 1, or face down for 0. Make the number 5. You need the 4 and 1 cards face up.
  4. Make 9, 12 and your age. Write down the 1s and 0s you used.
  5. Ask a friend to show a number with the cards and you read it.

Ask a grown-up: An adult can help check the answers by adding the face-up cards. This works without a computer.

Fun fact

Using just the fingers of one hand as five bits, you can count in binary from 0 all the way to 31.

Practice sheet

Check what you learned

Write your answers in a notebook, or print this sheet and write on it. When you finish, mark your work with the answer key.

Practice sheet: Binary numbers: how computers count (Classes 6-8, Computers and coding)

  1. Which two digits does a computer use for counting?
  2. What are the first four place values in binary, starting from the right?
  3. Change 101 to a usual number.
  4. Change 110 to a usual number.
  5. Change 1001 to a usual number.
  6. Write 6 in binary.
  7. Write 10 in binary.
  8. Change 1111 to a usual number.
  9. Write 20 in binary.
  10. Change 11111 to a usual number.
  11. How many bits are in one byte?

Answer key

Answers: Binary numbers: how computers count

Do the practice sheet first, then check here. If an answer is different from yours, read the lesson again and try once more.

  1. 0 and 1.
  2. 1, 2, 4, 8.
  3. 4 + 0 + 1 = 5.
  4. 4 + 2 + 0 = 6.
  5. 8 + 0 + 0 + 1 = 9.
  6. 6 = 4 + 2, so 110.
  7. 10 = 8 + 2, so 1010.
  8. 8 + 4 + 2 + 1 = 15.
  9. 20 = 16 + 4, so 10100.
  10. 16 + 8 + 4 + 2 + 1 = 31.
  11. 8 bits.
WhatsApp us