To convert binary to decimal, give each digit a place value that doubles from right to left (1, 2, 4, 8, …) and add up the values where there is a 1. So 1011 is 8 + 2 + 1 = 11. The number base converter does it instantly across binary, octal, decimal and hex.
That is the method. Here it is worked through, plus the reverse.
How binary place values work
Decimal, the system we use daily, gives each digit a place value that multiplies by ten as you move left: ones, tens, hundreds. Binary does the same thing but multiplies by two: ones, twos, fours, eights, sixteens. Each binary digit, or bit, is either 0 or 1, so a place value either counts or it does not.
Take 1011:
| Bit | 1 | 0 | 1 | 1 |
|---|---|---|---|---|
| Place value | 8 | 4 | 2 | 1 |
| Counts? | 8 | — | 2 | 1 |
Add the counted values: 8 + 2 + 1 = 11. So binary 1011 is decimal 11.
How to convert binary to decimal
By hand
Write the place values above each bit, doubling from the right, then add the ones that are switched on.
- 110 → 4 + 2 = 6
- 10000 → 16
- 11111111 → 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255
That last one is why a single byte (eight bits) holds values from 0 to 255.
Instantly
Type the binary number into the number base converter and read the decimal, with validation so a stray digit is caught rather than guessed.
How to convert decimal to binary
Divide the decimal number by 2 over and over, noting the remainder each time, then read the remainders from bottom to top.
Take 13:
- 13 ÷ 2 = 6 remainder 1
- 6 ÷ 2 = 3 remainder 0
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1
Reading the remainders upward gives 1101, which is decimal 13.
Where hexadecimal fits
Hexadecimal (base 16) is popular with programmers because each hex digit maps to exactly four bits, making it a compact way to write binary. So the byte 11111111 is FF in hex. The converter shows binary, octal, decimal and hex together, which makes the relationship between them clear at a glance.
To see why these bases also explain storage sizes, see how to convert MB to GB.