Binary Number Tool
Whole numbers only. Very large numbers are handled exactly with BigInt, so there is no rounding from floating point maths.
Binary is base 2, using only 0 and 1. It is how computers store numbers. Decimal is the base 10 system we use every day. This converter turns a binary string into the decimal number it stands for.
How to Use This Tool
- Enter a binary number: type digits 0 and 1 only.
- Click Convert: the decimal result appears at once.
- Copy the result: paste it into code, a document, or a calculation.
The Formula
Multiply each bit by 2 raised to the power of its position, counting from 0 on the right, then add the values. For example, 101010 is 32 plus 8 plus 2, which is 42.
Worked Examples
| Binary | Decimal |
|---|---|
| 1010 | 10 |
| 101010 | 42 |
| 11111111 | 255 |
| 10000000000 | 1024 |
Why Use This Tool
Binary values appear in programming lessons, networking, and electronics. Converting them to decimal makes them easier to compare and to use in everyday maths.
What Is Binary and What Is Decimal?
Binary is a number system with base 2. It uses only two digits, 0 and 1, called bits. Every value inside a computer is stored as a string of bits, because the circuits inside a machine have only two states, on and off. Decimal is the number system with base 10 that we use in everyday life. It uses the digits 0 to 9, and each position is worth ten times the position to its right. So the decimal number 245 means 2 hundreds plus 4 tens plus 5 ones. Binary works the same way, except each position is worth two times the position to its right, not ten times. That is the whole idea behind this converter: it reads each bit, works out what it is worth, and adds the values.
How to Convert Binary to Decimal Step by Step
You can convert any binary number to decimal by hand in four steps. The worked example below uses 1010, which converts to 10.
- Write the place values: label each bit with its place value, starting at 1 on the right and doubling as you move left: 1, 2, 4, 8, 16, and so on.
- Keep only the 1 bits: keep the place values under a 1 bit. Ignore the place values under a 0 bit, because they add nothing.
- Add them up: add the kept place values together.
- Read the total: the total is the decimal answer.
For 1010, the place values are 8, 4, 2, and 1 from left to right. The 1 bits sit under 8 and 2, so 8 plus 2 is 10. That is why 1010 in binary is 10 in decimal. Try a longer one: 101010 has 1 bits under 32, 8, and 2, so 32 plus 8 plus 2 is 42. Enter either value in the tool above and it shows the same answer with the steps worked out.
The Doubling Method
The doubling method is the fastest way to convert binary to decimal without a calculator. Start at 0, then read the bits from left to right. For each bit, double your running total, then add the bit. Here is 1010 again: start at 0, double to 0 and add 1 to get 1, double to 2 and add 0 to get 2, double to 4 and add 1 to get 5, double to 10 and add 0 to get 10. The answer is 10. The method works for any length, and it needs no powers table, only doubling and adding. If you convert binary numbers often, this is the method worth learning.
Powers of 2 Table
Each bit position in a binary number is worth a power of 2. The table below lists the first 17 powers, from 2 to the power 0 up to 2 to the power 16. Use it to work out any binary number up to 17 bits by hand.
| Power of 2 | Value |
|---|---|
| 2^0 | 1 |
| 2^1 | 2 |
| 2^2 | 4 |
| 2^3 | 8 |
| 2^4 | 16 |
| 2^5 | 32 |
| 2^6 | 64 |
| 2^7 | 128 |
| 2^8 | 256 |
| 2^9 | 512 |
| 2^10 | 1024 |
| 2^11 | 2048 |
| 2^12 | 4096 |
| 2^13 | 8192 |
| 2^14 | 16384 |
| 2^15 | 32768 |
| 2^16 | 65536 |
Binary to Decimal Conversion Table 0 to 31
The table below shows every whole number from 0 to 31 in binary and in decimal. Learn the first 16 rows and you can read any 4 bit value at a glance. Note that 1111 is 15, the largest 4 bit value, and 11111 is 31, the largest 5 bit value.
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
| 8 | 1000 |
| 9 | 1001 |
| 10 | 1010 |
| 11 | 1011 |
| 12 | 1100 |
| 13 | 1101 |
| 14 | 1110 |
| 15 | 1111 |
| 16 | 10000 |
| 17 | 10001 |
| 18 | 10010 |
| 19 | 10011 |
| 20 | 10100 |
| 21 | 10101 |
| 22 | 10110 |
| 23 | 10111 |
| 24 | 11000 |
| 25 | 11001 |
| 26 | 11010 |
| 27 | 11011 |
| 28 | 11100 |
| 29 | 11101 |
| 30 | 11110 |
| 31 | 11111 |
Common Mistakes
- Counting from the left: place values start at 1 on the right, so always count positions from the right. The leftmost bit is worth the most, not the least.
- Reading 10 as ten: in binary, 10 means 2, because the 1 sits in the 2s place. Ten in binary is 1010.
- Entering other digits: a binary number can only contain 0 and 1, so a digit such as 2 or 5 is not valid here.
- Adding every place value: only the 1 bits add to the total. A 0 bit means that place value is not counted.
- Using a binary point: this tool accepts whole numbers only, so a value such as 101.11 is rejected. The digits after a binary point need a different method.
Where Binary Values Appear
Binary numbers show up in far more places than programming lessons. A byte is a group of 8 bits, and it can hold any whole number from 0 to 255. That is why 255 is the largest value you see in so many places: the highest value of a color channel in RGB, the largest number in one part of an IP address, and the maximum value of an unsigned byte in code. An IP address such as 192.168.1.1 is four bytes written in decimal, and each part converts back to 8 bits. In networking, subnet masks are also binary values written in decimal, and working out how many addresses a network holds starts with counting bits. In files, every byte on disk is a binary value from 0 to 255, and text encodings such as ASCII map each character to one of those values. To turn text into binary, use the Text to Binary Converter. To turn text into other bases, use the Text to Hex Converter or the Text to ASCII Converter. To go the other way, from decimal back to binary, use the Decimal to Binary Converter. For other bases, use the Binary to Hex Converter, the Hex to Decimal Converter, the Decimal to Hex Converter, the Octal to Decimal Converter, the Binary to Octal Converter, or the Hex to Binary Converter. For octal, use the Decimal to Octal Converter, the Octal to Binary Converter, the Octal to Hex Converter, or the Hex to Octal Converter.
Frequently Asked Questions
Yes. It is free, needs no sign up, and runs in your browser.
Only 0 and 1. Any other digit shows a plain error message.
101010 in binary is 42 in decimal, because 32 plus 8 plus 2 is 42.
Yes. It uses BigInt, so long binary strings convert exactly.
No. It works in any modern browser on a phone, tablet, or computer.
1010 in binary is 10 in decimal, because 8 plus 2 is 10.
11111111 in binary is 255 in decimal. It is the largest value one byte can hold, because 128 plus 64 plus 32 plus 16 plus 8 plus 4 plus 2 plus 1 is 255.
1111 in binary is 15 in decimal, because 8 plus 4 plus 2 plus 1 is 15.
No. This tool converts whole numbers only. A value with a point, such as 101.11, is not accepted. Convert the whole part and the fractional part separately, or use a converter that supports binary fractions.
No. This tool reads binary as an unsigned whole number, so the top bit is a place value, not a sign. For example, 11111111 gives 255 here, not minus 1. If you need a signed reading, use a two's complement converter.