Binary to decimal converter
A binary to decimal calculator that shows its work: type a binary number to get its decimal value, with every step.
Prefixes 0b, 0o, 0x and spaces or underscores between digits are fine. A point starts the fraction.
How to convert binary to decimal
Write the place value over each bit: 1 on the right, then 2, 4, 8, 16 and so on, doubling each time. Multiply each bit by its place value and add the results. Bits that are 0 add nothing, so you only need to add the place values of the 1s.
| Digit | Place value | Digit × place value |
|---|---|---|
| 1 | 25 = 32 | 32 |
| 0 | 24 = 16 | 0 |
| 1 | 23 = 8 | 8 |
| 1 | 22 = 4 | 4 |
| 0 | 21 = 2 | 0 |
| 1 | 20 = 1 | 1 |
32 + 0 + 8 + 4 + 0 + 1 = 45, so 1011012 = 4510.
Binary to decimal table, 0 to 15
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | 10 | 1010 |
| 3 | 0011 | 11 | 1011 |
| 4 | 0100 | 12 | 1100 |
| 5 | 0101 | 13 | 1101 |
| 6 | 0110 | 14 | 1110 |
| 7 | 0111 | 15 | 1111 |
How it’s calculated
Conversions use exact whole-number arithmetic (JavaScript BigInt), so long numbers keep every digit. Fractions are kept as exact ratios; when the digits repeat, the repeating block is found and marked instead of rounded.
Questions
How do I convert a binary fraction?
Bits after the point are worth 1/2, 1/4, 1/8 and so on. 0.101 in binary is 1/2 + 1/8 = 0.625. Type the point into the converter and it handles the fraction exactly.
What about negative binary numbers?
Computers usually store them in two’s complement. Tick “Read as signed”, pick the width (8, 16, 32 or 64 bits) and 11101110 in 8 bits reads as −18.
Is there a size limit?
No practical one. The converter uses exact whole-number arithmetic, so a 200-bit number converts digit for digit.