How the binary to decimal converter works
Type a binary number into the Binary field and the decimal value appears in the result card as you type. The step-by-step panel then lays out the conversion the way it is taught: a table of every bit with its place value, the expansion written as a sum of powers of 2, and the final addition with the zero bits left out.
Any character that is not a 0 or 1 is highlighted, so a mistyped 2 is caught rather than dropped. The same tool converts the other way, from decimal to binary; the decimal to binary converter explains that method, and the binary converter covers hexadecimal, octal and custom bases.
The binary to decimal formula
Example: 1011 = 1 ร 2ยณ + 0 ร 2ยฒ + 1 ร 2ยน + 1 ร 2โฐ = 8 + 0 + 2 + 1 = 11. By doubling: 0 โ 1 โ 2 โ 5 โ 11.
Worked examples
Example 1 โ place values
- Binary:
- 10011100
- Place values of the 1 bits: 128, 16, 8, 4
- Add them: 128 + 16 + 8 + 4
Decimal: 156
Example 2 โ the doubling method
- Binary:
- 110101
- Bits 1, 1: 0ร2+1 = 1, 1ร2+1 = 3
- Bits 0, 1: 3ร2+0 = 6, 6ร2+1 = 13
- Bits 0, 1: 13ร2+0 = 26, 26ร2+1 = 53
Decimal: 53
Check with place values: 32 + 16 + 4 + 1 = 53.
Powers of 2: binary place values from 2โฐ to 2ยนโถ
| Power | Decimal | Binary |
|---|---|---|
| 20 | 1 | 1 |
| 21 | 2 | 10 |
| 22 | 4 | 100 |
| 23 | 8 | 1000 |
| 24 | 16 | 10000 |
| 25 | 32 | 100000 |
| 26 | 64 | 1000000 |
| 27 | 128 | 10000000 |
| 28 | 256 | 100000000 |
| 29 | 512 | 1000000000 |
| 210 | 1,024 | 10000000000 |
| 211 | 2,048 | 100000000000 |
| 212 | 4,096 | 1000000000000 |
| 213 | 8,192 | 10000000000000 |
| 214 | 16,384 | 100000000000000 |
| 215 | 32,768 | 1000000000000000 |
| 216 | 65,536 | 10000000000000000 |
Binary prefixes: where powers of 2 show up in storage
Memory sizes are counted in powers of 2, so the IEC defined binary prefixes for them in 1998 โ a kibibyte (KiB) is 2ยนโฐ = 1,024 bytes, while a kilobyte (kB) is 1,000 bytes.
| Prefix | Factor | Exact value |
|---|---|---|
| kibi (Ki) | 210 | 1,024 |
| mebi (Mi) | 220 | 1,048,576 |
| gibi (Gi) | 230 | 1,073,741,824 |
| tebi (Ti) | 240 | 1,099,511,627,776 |
| pebi (Pi) | 250 | 1,125,899,906,842,624 |
| exbi (Ei) | 260 | 1,152,921,504,606,846,976 |
Key facts
- A binary number's decimal value is the sum of the place values of its 1 bits, where the place values are 1, 2, 4, 8 and so on from the right.
- Eight bits can hold 0 to 255, because 11111111 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 = 2โธ โ 1.
- The doubling method converts binary left to right with no table: double the running total and add each bit, so 1101 gives 1, 3, 6, 13.
Common binary to decimal mistakes
- Numbering from the left. Place values start at 1 on the right-hand bit, whatever the length of the number.
- Starting at 2. The rightmost bit is worth 2โฐ = 1. Starting at 2 doubles the whole answer.
- Adding the 0 bits. Only places holding a 1 count; a 0 contributes nothing.
- Ignoring the format. A computer's 8-bit 11111011 may be โ5 in two's complement, not 251.
Binary to decimal conversion appears in England's GCSE computer science content (source: DfE subject content), so it is worth practising with the place values written out.
Frequently Asked Questions
What is 1010 in decimal?
1010 in binary is 10 in decimal. Its 1 bits sit in the 8 and 2 places, and 8 + 2 = 10.
What is 11111111 in decimal?
11111111 is 255. Eight 1 bits add up to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, which is 2โธ โ 1 โ the largest number one byte can hold without a sign.
What is the fastest way to convert binary to decimal in your head?
Use doubling. Start at 0 and read the bits from left to right: for each bit, double your running total and add the bit. For 1101: 0 โ 1 โ 3 โ 6 โ 13. It never needs a table of powers of 2, which makes it quick for long numbers.
Why does binary use powers of 2?
Binary is base 2, and in any base each place is worth the base times the place to its right. In decimal the places are 1, 10, 100 and so on; in binary they are 1, 2, 4, 8 and so on. Each bit only says whether that power of 2 is included.
Do leading zeros change a binary number?
No. 00101101 and 101101 are both 45. Leading zeros only pad a number to a fixed width, such as 8 bits for a byte. They matter for storage and display, not for the value.
How do I convert a negative binary number to decimal?
If it is written with a minus sign, convert the digits and keep the sign: โ101 is โ5. If it is a fixed-width bit pattern from a computer, such as 11111011 in 8 bits, it is probably two's complement, and the leading 1 means negative: that pattern is โ5, not 251.
Related calculators
Notes & Assumptions
- Binary input is read as a whole number. Binary points such as 101.11 are not accepted yet.
- A minus sign is kept as a sign. A fixed-width two's complement pattern is read as a positive number here, so 11111011 converts to 251.
- Working is shown for up to 64 bits; longer numbers still convert exactly.
This tool is for education and general calculation. Check results that feed into production code against your platform's documentation.