Developer Tools
Binary vs Decimal
Binary and decimal are two number systems that describe the same values in different ways. Binary is what computers use internally. Decimal is what humans use. Here is the comparison.
How each system works
Decimal (base-10)
- Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- Column values: 1, 10, 100, 1,000…
- Each column = 10× the previous
- Used by: humans, everyday math
Binary (base-2)
- Digits: 0, 1
- Column values: 1, 2, 4, 8, 16…
- Each column = 2× the previous
- Used by: all digital computers
Same number, different notation
The number thirteen is thirteen regardless of how you write it. In decimal: 13. In binary: 1101. In hexadecimal: D. These are all the same quantity — just different representations.
Decimal
13
Binary
1101
Hex
D
Side-by-side conversion table
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 9 | 1001 |
| 10 | 1010 |
| 15 | 1111 |
| 16 | 10000 |
| 99 | 1100011 |
| 100 | 1100100 |
| 127 | 1111111 |
| 128 | 10000000 |
| 255 | 11111111 |
| 256 | 100000000 |
Why binary numbers are longer
Binary needs more digits to represent the same number because each bit only carries 1 of 2 possible values (0 or 1), while each decimal digit carries 1 of 10 possible values. One decimal digit conveys log₂(10) ≈ 3.32 bits of information. So roughly speaking, a decimal number needs about 3.32 bits per digit.
This is a fair tradeoff. Decimal is compact and human-readable. Binary is simple and maps directly to transistor states. That is why you rarely see raw binary in modern programming — instead, hexadecimal (base-16) is used as a compact shorthand that still maps cleanly to binary groups of 4 bits.
Convert between decimal and binary
Two free tools. No sign-up, no install.
Frequently asked questions
What is the main difference between binary and decimal?
Decimal is base-10: it uses ten digits (0–9) and each column position is a power of 10. Binary is base-2: it uses two digits (0 and 1) and each column position is a power of 2. Both systems can represent any number — they are just two different ways of writing the same values.
Why is binary used in computers instead of decimal?
Computer hardware is built from transistors, which are switches that are either off (0) or on (1). Two states is all binary needs. Reliably distinguishing ten states (for decimal digits 0–9) would require much more complex circuitry and would be far less reliable at the billions-of-operations-per-second speeds that modern processors achieve.
What does binary 1000 equal in decimal?
Binary 1000 equals decimal 8. In binary, each bit position is a power of 2: the rightmost is 2^0=1, then 2^1=2, 2^2=4, 2^3=8. Binary 1000 has only the 2^3 bit set, so the decimal value is 8.
How many decimal digits does it take to represent a binary number?
A binary number with n bits can represent values from 0 to 2^n - 1. To find the maximum decimal digits: an 8-bit binary number reaches 255 (3 decimal digits). A 16-bit number reaches 65,535 (5 decimal digits). A 32-bit number reaches over 4 billion (10 decimal digits). Binary is always longer in digit count but shorter in hardware complexity.
What is base-10 and base-2 in simple terms?
The base of a number system tells you how many distinct digits it has and how column values scale. Base-10 (decimal) has ten digits and each column is worth 10 times the column to its right. Base-2 (binary) has two digits and each column is worth 2 times the column to its right. Base-16 (hexadecimal) has sixteen digits (0–9 and A–F) and each column is worth 16 times more. All three systems are in use in computing.
Can binary represent negative numbers?
Yes, but it requires a convention. The most common method is two's complement, used by virtually all modern computers. In two's complement, the leading bit indicates the sign: 0 means positive, 1 means negative. The 8-bit range in two's complement is -128 to +127. Without a sign convention, 8 bits is just 0–255 (unsigned). The same bits represent different values depending on the context.