Binary to Decimal
Type a binary number and get its everyday value, with the working written out two different ways.
The converter could not load. Refresh the page to try again.
How it was worked out
Why binary digits have different values
Binary works just like the numbers you use every day, with a smaller set of digits. In 365, the 3 is worth three hundred because of where it sits. Each place is worth ten times the one to its right.
In binary each place is worth double the one to its right, so you read a 1 as "count this place" and a 0 as "skip it".
| Position from the right | Power | Worth |
|---|---|---|
| 1 | 2^0 | 1 |
| 2 | 2^1 | 2 |
| 3 | 2^2 | 4 |
| 4 | 2^3 | 8 |
| 5 | 2^4 | 16 |
| 6 | 2^5 | 32 |
| 7 | 2^6 | 64 |
| 8 | 2^7 | 128 |
| 9 | 2^8 | 256 |
| 10 | 2^9 | 512 |
| 11 | 2^10 | 1,024 |
| 12 | 2^11 | 2,048 |
Method 1: add the place values
This is the one most classes teach. Let's convert 110101.
Label each bit from the right
Start at 1 on the far right and double as you move left: 1, 2, 4, 8, 16, 32.
Keep the places with a 1
Reading from the left, the bits are 1, 1, 0, 1, 0, 1, so you keep 32, 16, 4 and 1.
Add them up
32 + 16 + 4 + 1 = 53.
Method 2: keep doubling
This one reads the number from left to right, so you never need to work out place values first. Start at 0. For each bit, double your total and add the bit. It's handy when a long number is being read out to you.
110101: 1, 3, 6, 13, 26, 53
Each step is the same sum. The first 1 gives 0 × 2 + 1 = 1, the next gives 1 × 2 + 1 = 3, and the 0 gives 3 × 2 + 0 = 6. Doubling works because every bit you've already read moves one place to the left when another bit arrives.
Shortcuts worth knowing
The last bit tells you odd or even
Every place except the last is worth an even amount, so a number ending in 1 is odd and one ending in 0 is even. It's a quick way to check an answer.
A 1 followed by zeros is a power of 2
Count the zeros and that's the power. 10000000 has seven zeros, so it's 2 to the power of 7, or 128.
All ones is one less than the next power
1111 is one short of 10000, so it's 16 − 1 = 15. You can skip the adding altogether.
Subtract when most of the bits are on
11111011 looks long, but it's 11111111 with the 4 turned off, so it's 255 − 4 = 251.
Binary to decimal chart
Select a number to see its working above.
The largest number each size can hold
| Bits | Pattern | Largest value |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 11 | 3 |
| 3 | 111 | 7 |
| 4 | 1111 | 15 |
| 5 | 11111 | 31 |
| 6 | 111111 | 63 |
| 7 | 1111111 | 127 |
| 8 | 11111111 | 255 |
| 10 | 1111111111 | 1,023 |
| 12 | 111111111111 | 4,095 |
| 16 | 1111111111111111 | 65,535 |
Same bits, different number
A pattern of bits has no meaning until you know how it's being read. 11111011 is 251 if every bit counts as positive. If the program treats it as a signed 8-bit number, it's −5, because the leftmost bit counts as −128 and not +128.
−128 + 64 + 32 + 16 + 8 + 2 + 1 = −5
This converter gives the plain positive value. To see how negative numbers are stored, use the two's complement section of thebinary converter.
What about a binary point?
The converter handles whole numbers only, but fractions are easy by hand. Places to the right of the point keep halving, so they're worth ½, ¼, ⅛ and so on.
101.01 = 4 + 1 + 0.25 = 5.25
Where you'll see it
Every part of an IPv4 address is one byte written in decimal. Your computer sees 11000000.10101000 where you see 192.168. Converting by hand is how most people first make sense of subnet masks, and it's a staple of networking and computer science exams.
Where answers usually go wrong
Numbering the places from the left
The rightmost bit is always worth 1. If you start from the left, 110 comes out as 3, and it should be 6.
Starting at 2 instead of 1
The first place is 2 to the power of 0, which is 1. Starting at 2 doubles your whole answer, so 101 would become 10 instead of 5.
Losing your place in a long number
Split long numbers into groups of four and convert each one. Mistakes are much easier to spot in 1101 0110 than in 11010110.
Reading it like a decimal number
1010 is "one zero one zero", not one thousand and ten. Its value is 10.
Try these yourself
Work each one out on paper before you open it.
What is 1011 in decimal?
11, because 8 + 2 + 1 = 11. It ends in 1, so you know the answer is odd.
What is 100110 in decimal?
38, because 32 + 4 + 2 = 38.
What is 11110000 in decimal?
240. The top four bits give 128 + 64 + 32 + 16. You could also take 255 − 15.
Common questions
What is 1111 in decimal?
It's 15. All four bits are on, so you get 8 + 4 + 2 + 1, or 16 − 1.
What is the largest 8-bit number?
255, written 11111111. Counting 0, one byte can hold 256 different values.
Do zeros at the front change the value?
No. 00000101 and 101 are both 5. Computers often store the extra zeros to fill a fixed width.
Can I paste binary with spaces?
Yes. Spaces, underscores and a 0b prefix are all ignored. To read several bytes as text and not as one number, use binary to text.
How long can the number be?
Up to 16,384 bits, with no rounding. The working is shown for up to 64 bits.
Is my number sent anywhere?
No. The conversion runs in your browser, so it never reaches our server. A link you copy from the address bar can contain the number.