About the Binary to Decimal
Convert binary to decimal as you type: paste a string of 0s and 1s and read its base-10 value straight away. Students use it to check base 2 to base 10 homework. Programmers use it to read bit masks or register dumps, or to decode a byte printed in a networking or electronics manual.
However long the input, the value is exact. A 64-bit pattern of all ones comes out as 18446744073709551615 down to the last digit, where ordinary floating-point arithmetic would round it. Anything that isn't a binary digit is pointed out instead of being quietly ignored.
How it works
Each position in a binary number is worth twice the one to its right: 1, 2, 4, 8, 16 and so on, counting from the rightmost bit. The decimal value is the sum of the place values where the bit is 1. Bits set to 0 add nothing.
The converter reads the digits from left to right, doubling the running total and adding the next bit each time. That gives the same answer as adding up powers of two, and it uses whole-number arithmetic of unlimited size (BigInt), so there is no floating-point rounding even for numbers with hundreds of bits.
decimal = bₙ×2ⁿ + … + b₂×2² + b₁×2¹ + b₀×2⁰ where b₀ is the rightmost bit (0 or 1) and n is the position of the leftmost bit. Left-to-right shortcut: total = total × 2 + next bit
Reading the leftmost bit first is also how you can do it in your head: start at 0, and for each bit double what you have and add the bit.
Assumptions and limits
- Input is treated as an unsigned whole number. 11111111 reads as 255, not −1; if your bits are a two's complement signed value, subtract 2⁸ (or 2¹⁶, 2³², …) yourself when the top bit is 1.
- A leading minus sign is kept as a plain sign, so −1010 gives −10.
- You may write a 0b prefix and separate groups with single spaces or underscores, such as 1010 1010 or 0b1100_0000. Commas, letters and digits other than 0 and 1 are refused with a message naming the bad character; a single point is refused as a fraction.
- Binary fractions such as 10.1 aren't supported. Inputs are limited to 4,096 digits so a huge paste can't freeze the page.
Worked examples
Convert binary 101101 to decimal
This is the number the page opens with. Reading left to right: 1, then 1×2+0 = 2, 2×2+1 = 5, 5×2+1 = 11, 11×2+0 = 22, 22×2+1 = 45.
1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 32 + 8 + 4 + 1 = 45
One byte of an IP address
Network books often show an address bit by bit. Typing 1100 0000 (with the space) gives 192, and 1010 1000 gives 168, the first two parts of 192.168.x.x. Convert each 8-bit group separately, because the dots between octets aren't accepted.
A 32-bit mask of all ones
Paste 1111 1111 1111 1111 1111 1111 1111 1111 and the result is 4294967295, which is 2³² − 1, the largest unsigned 32-bit value. Add one more 1 and the answer doubles plus one, to 8589934591.
Binary to decimal reference
Each row reads both ways: the binary on the left equals the decimal on the right.
| Binary | Decimal | Note |
|---|---|---|
| 0 | 0 | |
| 1 | 1 | 2⁰ |
| 10 | 2 | 2¹ |
| 11 | 3 | |
| 100 | 4 | 2² |
| 101 | 5 | |
| 111 | 7 | three bits all set |
| 1000 | 8 | 2³ |
| 1010 | 10 | |
| 1111 | 15 | one hex digit, F |
| 10000 | 16 | 2⁴ |
| 100000 | 32 | 2⁵ |
| 1000000 | 64 | 2⁶ |
| 1111111 | 127 | largest 7-bit value |
| 10000000 | 128 | 2⁷ |
| 11111111 | 255 | largest byte |
| 100000000 | 256 | 2⁸ |
| 10000000000 | 1024 | 2¹⁰ |
How to use the Binary to Decimal
- Enter the binary number. Replace the sample 101101 with your bits; a 0b prefix and single spaces between groups are fine.
- Check the base-10 number. The decimal answer changes on every keystroke, or a red message says which character isn't 0 or 1.
- Copy the decimal. Copy Result puts the number on your clipboard for a worksheet, spreadsheet or code comment.
Frequently asked questions
How do you convert binary to decimal by hand?
Write the place values 1, 2, 4, 8, 16 and so on under the bits, starting from the right. Add up the place values that sit under a 1. For 1101 that is 8 + 4 + 1 = 13.
Why does 11111111 give 255 and not −1?
Because the tool reads bits as an unsigned number. In an 8-bit two's complement system the same pattern means −1, because the top bit counts as −128. If you need the signed meaning, subtract 256 from any byte result of 128 or more.
What is the largest binary number this converter can handle?
Up to 4,096 binary digits, and every one is converted exactly. That is far beyond 64-bit values, which top out at 18446744073709551615, and well past the 53 bits that ordinary floating-point numbers can hold exactly.
Can I paste binary with spaces between the bytes?
Yes. One space or underscore between groups of bits is ignored, so 0110 0001 works and gives 97. Two separators in a row, or an underscore at the very start or end of the digits, is refused so typos don't slip through.
Does it convert binary fractions like 0.101?
No. Only whole numbers are accepted, and an input with a point is refused with a message. For a fraction, convert the whole part here and add each bit after the point by hand: 0.101 is 1/2 + 1/8 = 0.625.
Is anything I type sent to a server?
No. The conversion is plain arithmetic done by your browser as you type, so the numbers you enter never leave your device and the page keeps working if your connection drops.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.