Binary Number System
The binary number system (base 2) is used by every digital computer and electronic device. Instead of the ten digits 0–9 used in decimal, binary uses only two digits: 0 and 1. Place values in binary are powers of 2 instead of powers of 10.
Binary arithmetic was first fully worked out by the German mathematician Gottfried Wilhelm Leibniz, who developed the system in manuscripts as early as 1679 and published it formally in 1703. Over a century later, the English mathematician George Boole built an entire system of logic around just two values, true and false, in his 1854 book An Investigation of the Laws of Thought — the foundation of what we now call Boolean algebra. The final link to modern computing came in 1937, when the American engineer Claude Shannon showed in his master's thesis that Boolean algebra could be built directly out of electrical switching circuits. That single insight became the working principle behind every digital computer built since.
Binary shows up everywhere in modern technology, often without you noticing it. Every file on a computer — a photo, a song, or this very web page — is stored as a long string of binary digits (called bits), usually grouped into bytes of 8 bits at a time. Computer processors add, compare, and move numbers using binary arithmetic at the hardware level, because an electronic circuit can very reliably represent just two states: a high voltage (1) or a low voltage (0). Devices on the internet are addressed using binary-based IP addresses, digital cameras record each pixel's colour as binary numbers, and barcodes and QR codes ultimately encode binary data as patterns of light and dark. Understanding binary place value is therefore not just a maths exercise — it is the foundation of how modern digital technology actually works.
Binary Place Values
| Place | Power of 2 | Value in Decimal |
|---|---|---|
| 1st (rightmost) | 2⁰ | 1 |
| 2nd | 2¹ | 2 |
| 3rd | 2² | 4 |
| 4th | 2³ | 8 |
| 5th | 2⁴ | 16 |
| 6th | 2⁵ | 32 |
| 7th | 2⁶ | 64 |
| 8th | 2⁷ | 128 |
Converting Binary to Decimal
Every binary number is really just a sum in disguise. Each digit (called a bit) sits in a place worth a power of 2, exactly the way each digit in a decimal number sits in a place worth a power of 10. To convert binary to decimal, multiply each bit by the value of the place it sits in, then add up every place where that bit is a 1. Places holding a 0 contribute nothing, so you can also think of it as simply adding together the place values of every 1 in the number.
= (1×8) + (0×4) + (1×2) + (1×1)
= 8 + 0 + 2 + 1
= 11
Here is a larger example using a full byte (8 bits), the standard unit computers use to store a single value:
= (1×128) + (0×64) + (1×32) + (1×16) + (0×8) + (1×4) + (0×2) + (1×1)
= 128 + 32 + 16 + 4 + 1
= 181
Notice that the calculation is identical no matter how many bits are involved — you are always doing the same two steps: multiply each digit by its place value, then add the non-zero results together.
See It Animated: Binary to Decimal
Click through each bit below, in order, to watch its place value join the running total. A new random number is generated each time you load this page or press Reset.
Converting00000000 (binary)
128 + 32 + 16 + 4 + 1 = 181.
More Conversion Examples
| Binary | Calculation | Decimal |
|---|---|---|
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0101 | 4 + 1 | 5 |
| 1000 | 8 | 8 |
| 1111 | 8+4+2+1 | 15 |
| 10000 | 16 | 16 |
Practice: Binary to Decimal
Convert the binary number below into decimal. If you get it wrong (or leave it blank), we'll walk through the correct answer with you, one digit at a time.
Converting Decimal to Binary
Converting the other way — from decimal to binary — uses the fact that any whole number can be broken down into powers of 2 by repeatedly dividing it by 2 and keeping track of the remainder each time. Each remainder is always either 0 or 1, because you are dividing by 2, and those remainders are exactly the bits of the binary answer. The only trick is that the first remainder you calculate is the last digit of the binary number, so once you run out of number to divide, you read the remainders back in reverse — from bottom to top.
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read remainders bottom to top: 13 = 1101 in binary
A second, often faster method is to subtract the largest power of 2 that still fits, mark that place with a 1, and repeat with what's left over. Converting 45 this way:
13 − 8 = 5 (place value 8, write 1)
5 − 4 = 1 (place value 4, write 1)
1 − 1 = 0 (place value 1, write 1)
45 = 101101 in binary
Both methods always agree — use whichever one makes more sense to you. The repeated-division method is easier to do reliably without mental arithmetic, while the subtract-the-largest-power method is often quicker once you have memorised your powers of 2.
See It Animated: Decimal to Binary
Click through each division step below, and watch the binary answer assemble itself — each new remainder joins the front of the answer, since the first remainder you find is actually the last digit. A new random number is generated each time you load this page or press Reset.
Converting13 (decimal)
Reading the remainders from bottom to top gives 1101.
Practice: Decimal to Binary
Convert the decimal number below into binary. If you get it wrong (or leave it blank), we'll divide by 2 together, step by step, until we reach the correct answer.
Why Binary?
Electronic circuits can easily represent two states: on (1) and off (0). This maps perfectly to binary digits, making binary the natural language of computers.
- Binary uses only digits 0 and 1.
- Each place is a power of 2: 1, 2, 4, 8, 16, 32, …
- To convert binary to decimal: sum the place values where a 1 appears.
- To convert decimal to binary: divide repeatedly by 2 and read remainders upward.
- Computers store all data as binary (bits).
Summary
Binary place values work exactly like decimal place values but with powers of 2 instead of powers of 10. Every decimal number has a unique binary equivalent, and this conversion is the foundation of all digital computing. Understanding binary place value builds the bridge between pure mathematics and computer science.
