Binary to Decimal Converter
Convert binary numbers of any length to decimal, including signed two’s complement values at 8, 16, 32 or 64 bits.
Any length works. Spaces, underscores and a 0b prefix are ignored. Everything runs on your device.
How to use Binary to Decimal Converter
- Type or paste a binary number. Spaces, underscores and a leading 0b are ignored, and a leading minus sign makes it negative.
- To read a fixed-width signed value, choose a two’s complement width; the top bit then counts as the sign.
- Copy the decimal result, or press Swap to convert decimal back to binary. The other buttons switch to text, hex and decimal conversions.
How binary becomes decimal
Each binary digit is worth twice the one to its right: 1, 2, 4, 8, 16 and so on. Add up the values of the digits that are 1. For 1010 that is 8 + 2 = 10. The converter uses arbitrary-precision integers, so even numbers hundreds of digits long come out exact.
| 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 |
A few useful answers
What is two’s complement?
It is how computers store signed whole numbers. At a width of w bits, a pattern whose top bit is 1 means its value minus 2^w, so 11111111 at 8 bits is −1 and 10000000 is −128.
Why does my number show an error?
The message names the first character that is not a 0 or 1 and its position. Remove it, or switch to another conversion if the value is decimal, hex or text.
What happens to my input?
This tool processes input in your browser. It does not upload anything to a server.
Related conversions: decimal to binary, binary to hex, binary to text.
How to use the binary to decimal
Read a binary number as a decimal whole number, even when it has many digits. You can also interpret a fixed-width bit pattern as a signed value.
Enter zeros and ones, optionally choose a two’s complement width, then copy the decimal result.
- The page opens in Binary → Decimal mode with 1010 1010 as an example. Replace it with your bits.
- Spaces, underscores and a 0b prefix are skipped. A leading minus sign makes the result negative.
- To read a signed value, pick 8-bit, 16-bit, 32-bit or 64-bit under “Read input as two’s complement”.
- Read the decimal result and its digit count, then press Copy decimal.
Good to know
- Spaces, underscores and a leading 0b prefix are accepted.
- Without two’s complement, a leading minus sign makes the value negative.
- Two’s complement accepts widths of 8, 16, 32 or 64 bits and rejects input longer than the width.
- Input is capped at 1,000,000 characters and converted in your browser.
Examples
- 1010 1010 → 170. With 8-bit two’s complement, the same bits give -86.
- 10000000 at 8-bit → -128, the lowest 8-bit value.
- Sixty-four 1s → 18446744073709551615, or -1 at 64-bit two’s complement.
If something goes wrong
9 bits is more than the 8-bit width you chose.
Pick a wider width or remove extra leading bits. The input may be shorter than the width, but not longer.
In two’s complement mode, enter the bit pattern without a minus sign; the top bit is the sign.
Delete the minus sign, or set the width back to Off to use a sign.
Character "x" at position 2 is not a binary digit (use only 0 and 1).
A 0x prefix means hex. Use one of the hex conversions instead.
Questions
What is 1010 in decimal?
It is 10: the set bits are worth eight and two.
Why is 11111111 sometimes −1?
At an eight-bit two’s complement width, the top bit makes that pattern negative.
Can I enter a minus sign in two’s complement mode?
No. Enter the bits without a sign in that mode.
Why is 1111 not −1 at 8 bits?
Shorter input is padded with zeros, not copies of the top bit, so 1111 is read as 00001111, which is 15. Type all eight bits, 11111111, to get −1.
