How do you convert binary to decimal?
To convert binary to decimal, multiply each bit by its place value and add the results. Place values are powers of two, starting at 1 on the right and doubling each step left: 1, 2, 4, 8, 16, 32, 64. So 1100100 is 64 + 32 + 4, which is 100 in decimal. This converter does that sum for you.
Binary is base 2, so each position can only hold a 0 or a 1. A 1 means "include this power of two" and a 0 means "skip it". Decimal works identically with powers of ten, which is why the method feels familiar once you see it laid out.
Using the converter
- Type or paste a binary number, for example
101101. - Click Convert.
- Copy the decimal result.
Leading zeros are fine: 00001 gives 1. Spaces around the number are trimmed, so a value copied with a trailing newline still works. Clearing the box clears the output without an error.
Worked example: 1100100
Line up the bits with their place values:
| Place value | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| Bit | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
| Contributes | 64 | 32 | 0 | 0 | 4 | 0 | 0 |
64 + 32 + 4 = 100, which matches what the tool prints.
The doubling shortcut
Writing out a table gets tedious past eight bits. A faster mental method reads the bits left to right and keeps a running total: double the total, then add the current bit. For 101011:
- start at 0
- bit 1: 0 × 2 + 1 = 1
- bit 0: 1 × 2 + 0 = 2
- bit 1: 2 × 2 + 1 = 5
- bit 0: 5 × 2 + 0 = 10
- bit 1: 10 × 2 + 1 = 21
- bit 1: 21 × 2 + 1 = 43
The answer is 43, and you never had to know that the leftmost bit was worth 32. This is Horner's method, and it's also the shortest way to write a binary parser yourself.
Where you meet binary that needs decoding
The most common real case is networking. An IPv4 address is a 32-bit number (RFC 791), usually written as four decimal octets. Each octet is eight bits:
| Binary octet | Decimal |
|---|---|
11000000 |
192 |
10101000 |
168 |
00000001 |
1 |
11111111 |
255 |
Convert the octets one at a time to get the dotted form 192.168.1.1. If you paste all 32 bits together, 11000000101010000000000100000001, you get 3232235777, the same address as a single integer, which is how some databases and logging tools store it. A /24 subnet mask, twenty-four 1s followed by eight 0s, comes out as 4294967040.
You'll also run into binary in permission bitmasks, hardware register docs and status flags, where each bit means something on its own. Converting to decimal gives you the number to compare against in code.
Limits and error messages
The tool parses with JavaScript's parseInt and refuses any result that isn't a safe integer. In practice:
| Input | Result |
|---|---|
| 53 ones in a row | 9007199254740991, the largest exact value |
| 54 digits starting with 1 | "That number is too large to convert precisely." |
0b1010 |
"Enter a valid binary number..." (remove the 0b) |
1010 1011 |
Same error; delete the space first |
-101 or 10.1 |
Same error; signs and fractions aren't supported |
Rejecting oversized values is deliberate. Past 53 bits a double-precision float can't represent every integer, so a converter that silently rounds would give you a confidently wrong answer.
Signed values need one extra step
Binary on its own has no sign. Whether 11111111 means 255 or -1 depends on whether the program treats it as unsigned or as two's complement. This tool always answers unsigned. For an n-bit signed value whose top bit is 1, subtract 2 to the power n from the result: 255 - 256 = -1 for an 8-bit byte.
Related conversions
- Decimal to binary goes the other way, showing how a decimal number breaks into powers of two.
- Binary to hexadecimal is the better choice when you're comparing against a hex dump or memory address.
- Text to binary shows the bytes behind each character if your binary came from text.
- The programming fundamentals lessons are the place to start if you're new to code, beginning with variables and data types.
Last updated