All guides

How Binary Numbers Work: Counting With Two Digits

Place value, but with twos

Binary uses the same place value idea as the decimal numbers you grew up with, except each place is worth twice the one before instead of ten times. In decimal, the places are 1, 10, 100, 1000. In binary they are 1, 2, 4, 8, 16, 32, 64, 128. To read a binary number, add up the places where a 1 appears. The number 1101 has ones in the 8, 4 and 1 places, so it means 13. Any whole number can be written this way, and with eight places, one byte, you can count from 0 to 255. With 32 bits, the standard size inside processors, the count reaches over four billion.

Why machines count this way

Computers use binary because their hardware is built from switches. A transistor is either conducting or not, a magnetic spot is one way or the other, a voltage is high or low. Two states are easy to build reliably and hard to confuse, even with electrical noise. Ten states would be a nightmare of precision. Everything richer is layered on top: numbers become patterns of bits, letters become numbers through codes like ASCII, and pictures become long lists of numbers for pixel colours. When programmers look at raw binary they usually group it in fours and read it as hexadecimal, one hex digit per group, which is far kinder to human eyes.

Reading binary without fear

A few anchors make binary friendly. Powers of two recur everywhere in computing: 8 bits in a byte, 256 values per byte, 1024 bytes in a kibibyte, 65536 in two bytes. A binary number ending in 0 is even, ending in 1 is odd. Adding a 0 to the end doubles the value, exactly like adding a 0 in decimal multiplies by ten. To convert by hand, work from the left, doubling and adding each next digit: for 10110, start 1, double plus 0 is 2, double plus 1 is 5, double plus 1 is 11, double plus 0 is 22. The converter here checks your working instantly, which is the fastest way to build the instinct. If you want the instinct rather than the rule, practise with the numbers computing throws at you daily: 255 in an IP address, 1024 in a memory size, 65535 in an old port limit. Each is one less than a power of two, a byte or two bytes filled with ones. Spotting those landmarks in the wild is the moment binary stops being a school topic and becomes a lens you read systems through. The converter below will check any number you meet.

Try the calculator

The free tool that goes with this guide:

Convert binary to decimal