Developer Tools
The Binary Number System Explained
Everything inside a computer — numbers, text, images, instructions — is stored as binary. Here is exactly how it works and why.
Two digits, endless possibilities
Decimal (the number system you grew up with) is base-10. It has ten digits: 0 through 9. Each position in a decimal number is a power of 10: ones, tens, hundreds, thousands.
Binary is base-2. It has only two digits: 0 and 1. Each position is a power of 2: 1, 2, 4, 8, 16, 32, 64, 128. The math works exactly the same way — you just have fewer digits to work with before you carry over.
Decimal 347
3×100 + 4×10 + 7×1
Binary 1011
1×8 + 0×4 + 1×2 + 1×1
Counting in binary
Once you hit 1, you have used every available digit. So you carry over to the next position — just like decimal carries over from 9 to 10.
Notice that the rightmost column alternates every 1 step. The middle column every 2 steps. The leftmost every 4 steps. Each column runs at half the frequency of the one to its right — exactly how clocks work.
Bits and bytes
A single binary digit is called a bit. Eight bits make a byte. A byte can hold values from 0 (00000000) to 255 (11111111) — 256 possible values in total.
This explains a number that appears everywhere in computing: 255. It is the maximum value of a byte. RGB color channels go 0–255. ASCII character codes fit in a byte. IPv4 address segments (like 192.168.1.1) max out at 255. Once you understand bytes, a lot of arbitrary-seeming numbers in tech start making sense.
Binary in the real world
Every file on your computer is binary data. A 1 MB text file is roughly one million bytes — eight million individual bits. A 10 MP camera photo contains tens of millions of bytes worth of pixel data, each pixel represented by three bytes (one each for red, green, and blue).
Network speeds in Mb/s (megabits per second) vs. MB/s (megabytes per second) differ by a factor of 8 — because 1 byte = 8 bits. Internet providers advertise in megabits; file downloads show megabytes.
Convert binary numbers instantly
Paste any binary number and see the decimal value with a full positional breakdown.
Binary to Decimal Converter →Frequently asked questions
What is the binary number system?
The binary number system is a base-2 numbering system that uses only two digits: 0 and 1. Every number, letter, image, and instruction inside a computer is stored and processed as a sequence of 0s and 1s. It is the fundamental language of all digital electronics because transistors — the building blocks of chips — have two states: off (0) and on (1).
Why do computers use binary instead of decimal?
Computers are built from transistors, which are tiny switches that are either off or on. Two states maps perfectly to binary's two digits: 0 and 1. It would be extremely difficult and expensive to build hardware that reliably distinguishes ten voltage levels (for decimal digits 0–9), but distinguishing two states (low voltage vs. high voltage) is straightforward and reliable at billions of operations per second.
How do you count in binary?
Counting in binary follows the same logic as decimal but you run out of digits after 1 (instead of after 9). After 0 comes 1, then you carry over: 10 (two), 11 (three), 100 (four), 101 (five), 110 (six), 111 (seven), 1000 (eight). Each time all current digits are 1, you add a new leading digit. The pattern of rightmost columns cycling through 0 and 1 is exactly like a clock's seconds, minutes, and hours — each column cycles at half the speed of the column to its right.
What is a bit?
A bit is the smallest unit of data in computing. The word is a contraction of binary digit. A bit holds a single value: either 0 or 1. On its own a bit can represent two states — off/on, false/true, no/yes. Groups of bits represent larger values: 4 bits (a nibble) can represent 0–15, 8 bits (a byte) can represent 0–255.
What is a byte and how many binary digits does it have?
A byte is 8 bits. It is the standard unit for measuring data storage and file sizes. An 8-bit byte can hold values from 0 (00000000) to 255 (11111111), giving 256 possible values. This is why things like ASCII characters, RGB color channels, and pixel values in images max out at 255 — they each fit in one byte.
How is binary related to hexadecimal?
Hexadecimal (base 16) is shorthand for binary. Every group of 4 binary bits maps to one hex digit: 0000 = 0, 0001 = 1, … 1111 = F. So the binary number 11010110 splits into 1101 (= D) and 0110 (= 6), giving 0xD6. Programmers use hex because it is much shorter to write and read than long binary strings while still mapping directly to the underlying bit patterns.