Binary to decimal converter
Convert binary numbers to decimal — by adding up each digit times its power of 2. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.
Part of developer tools.
Binary
10101101
Octal
255
Decimal
173
Hexadecimal
AD
Binary to decimal table
| Binary | Decimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 10 | 2 |
| 11 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | 10 |
| 1011 | 11 |
| 1100 | 12 |
| 1101 | 13 |
| 1110 | 14 |
| 1111 | 15 |
| 10000 | 16 |
| 1100100 | 100 |
| 1111111 | 127 |
| 11111111 | 255 |
| 100000000 | 256 |
| 1111101000 | 1000 |
| 10000000000 | 1024 |
| 1000000000000 | 4096 |
| 1111111111111111 | 65535 |
| 11111111111111111111111111111111 | 4294967295 |
| 1111111111111111111111111111111111111111111111111111111111111111 | 18446744073709551615 |
The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.
How to convert binary to decimal
Each binary digit stands for a power of two — 1, 2, 4, 8, 16 and so on, counting from the right — so the decimal value is simply the sum of the powers where the bit is 1; the 0 bits contribute nothing. For 10101101: 2⁷ + 2⁵ + 2³ + 2² + 2⁰ = 128 + 32 + 8 + 4 + 1 = 173.
Binary and decimal side by side
The largest 16-bit value is 1111111111111111 in binary and 65535 in decimal: 16 digits against 5. A decimal digit is worth log₂ 10 ≈ 3.32 bits — not a whole ratio, so decimal and binary digits never line up and there is no digit-by-digit shortcut: the whole number has to be added up, as above. Binary is what bit masks, flags and subnet masks are reasoned in: a /24 network mask is twenty-four 1 bits followed by eight 0 bits, 255.255.255.0 once written in decimal. In JavaScript and Python source, 173 is written 0b10101101 in binary and 173 with no prefix in decimal. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — binary on this page.
Other conversions
Going the other way? Decimal to binary converter.
Or open the full number base converter and see a number in all four bases at once.