Computer Science

Binary

Storing numbers, pictures, and more using only 0s and 1s.

What's really going on

Inside a computer, everything is stored as switches that are either off or on, written as 0 and 1. A single 0 or 1 is called a bit. Put enough bits together and they can stand for any number, and with an agreed-on code, those numbers can stand for letters, colors in a photo, or sounds in a song. Every text, picture, and video on your phone is a very long string of 0s and 1s.

For educators

Background

Binary is base 2: each place value doubles (1, 2, 4, 8, and so on) instead of multiplying by 10. With n bits you can represent 2n different values, so 8 bits (a byte) gives 256. Text, images, and sound are stored by agreeing on a code that maps numbers to meaning, such as ASCII or Unicode for characters and RGB values for pixel colors. Unplugged work with cards or light switches lets students discover the place values and the doubling pattern for themselves.

Misconceptions

  • Computers “think” in 0s and 1s. Bits are a way of storing and moving information; the meaning comes from the code or program that interprets them.
  • Binary numbers are different numbers. 101 in binary and 5 in decimal are the same quantity written in different bases.
  • Each 0 or 1 means something on its own. A single bit only means something as part of a group read with an agreed-on code.