How to convert binary to decimal
Every digit in a binary number has a place value, and the place values are powers of 2. The rightmost digit is worth 1, the next one 2, then 4, 8, 16 and so on, doubling at each step to the left. To convert a binary number to decimal, add up the place values of the digits that are 1. Digits that are 0 add nothing.
The converter above does the same addition and shows it in the place value table under the result. You can paste several numbers at once, separated by spaces or on separate lines. Each one is converted on its own, and clicking a number in the input shows its working.
Place values of binary digits
Bits are counted from the right, starting at 0. The value of bit n is 2 to the power n.
| Bit | Power | Place value |
|---|---|---|
| 0 | 20 | 1 |
| 1 | 21 | 2 |
| 2 | 22 | 4 |
| 3 | 23 | 8 |
| 4 | 24 | 16 |
| 5 | 25 | 32 |
| 6 | 26 | 64 |
| 7 | 27 | 128 |
| 8 | 28 | 256 |
| 9 | 29 | 512 |
| 10 | 210 | 1,024 |
| 11 | 211 | 2,048 |
| 12 | 212 | 4,096 |
| 13 | 213 | 8,192 |
| 14 | 214 | 16,384 |
| 15 | 215 | 32,768 |
| 16 | 216 | 65,536 |
| 31 | 231 | 2,147,483,648 |
| 32 | 232 | 4,294,967,296 |
| 63 | 263 | 9,223,372,036,854,775,808 |
The largest number that n bits can hold is one less than the next place value: 255 for 8 bits, 65,535 for 16 bits and 4,294,967,295 for 32 bits.
A faster way: double and add
For long numbers you can skip the place values. Start with 0. For each digit from left to right, double what you have and add the digit. When the digits run out, you have the answer.
This works for any length, and you never need to know which power of 2 a digit stands for, so it is also handy for working in your head.
Binary numbers 0 to 15
| Binary | Decimal | Binary | Decimal |
|---|---|---|---|
| 0000 | 0 | 1000 | 8 |
| 0001 | 1 | 1001 | 9 |
| 0010 | 2 | 1010 | 10 |
| 0011 | 3 | 1011 | 11 |
| 0100 | 4 | 1100 | 12 |
| 0101 | 5 | 1101 | 13 |
| 0110 | 6 | 1110 | 14 |
| 0111 | 7 | 1111 | 15 |
Four bits give exactly 16 values, which is why one hex digit stands for four bits. The binary to hex converter uses that to shorten long binary numbers.
Negative numbers: two’s complement
Computers store negative whole numbers in two’s complement. The leftmost bit gets a negative place value. In 8 bits it is worth −128 instead of 128, and every other bit keeps its usual value.
Set Signed to On in the converter to read numbers this way. The width is the number of digits you type, so 11111011 is read as 8 bits and gives −5, while 011111011 is read as 9 bits and gives 251. A number that starts with 0 has the same value either way.
The bits alone cannot tell you whether 11111011 means 251 or −5. That depends on how the program that wrote them stores numbers. To go the other way, the decimal to binary converter shows how −5 becomes 11111011.
Binary fractions
Digits after a binary point have place values too. They are halves, quarters, eighths and so on.
Every binary fraction has an exact decimal value, and the converter prints it in full. The other direction is harder, because many decimal fractions such as 0.1 never end in binary.
When the binary is text
Binary from a puzzle or a message is often text, with each group of 8 bits standing for one character. 01001000 is 72 in decimal, and 72 is the character code for H. This page gives you the numbers. To read the letters, paste the same binary into the Binary Translator.
Questions about binary to decimal
What is 01100110 in decimal?
102. The bits that are 1 sit on the place values 64, 32, 4 and 2, and 64 + 32 + 4 + 2 = 102. Read as a character code, 102 is a lowercase f.
What is 10101 in decimal?
21. The 1 bits are worth 16, 4 and 1, and 16 + 4 + 1 = 21.
What is 11111111 in decimal?
255, the largest number that fits in 8 bits. Read as a signed 8-bit number in two's complement, the same bits mean -1.
Do leading zeros change the value?
No. 0110 and 110 are both 6. Leading zeros only matter when you read the number as signed, because then the number of digits sets the width and the first digit is the sign.
What is the largest number n bits can hold?
2 to the power n, minus 1. That is 255 for 8 bits, 65,535 for 16 bits and 4,294,967,295 for 32 bits. Signed numbers in two's complement run from -128 to 127 in 8 bits.
Is my input sent to a server?
No. The conversion runs in your browser with JavaScript, and nothing you type leaves your device.