Free tool
Binary to Decimal Converter
Convert a binary number to decimal and see which powers of 2 add up to the result. Hex and octal are shown too.
- Binary
- –
- Octal
- –
- Decimal
- –
- Hex
- –
Binary (base 2) is how computers store every number: each digit, or bit, is either 0 or 1. Reading a binary number as decimal is a matter of adding up powers of 2, and this converter shows exactly which ones. It also gives the hex and octal forms, which are shorter ways to write the same bits.
How to use the binary to decimal converter
- Type or paste the binary number. A
0bprefix is optional, and spaces and underscores are ignored, so1100 1000and0b1100_1000both work. - Leave Convert from set to binary. You can switch it to octal, decimal or hex at any time.
- Read the decimal result, along with the octal and hex forms.
- Check the working under the result: each bit times its power of 2, added up.
- Use the copy button next to any result to copy it.
How it works
In binary, each position is worth twice the position to its right. The rightmost bit is worth 2⁰ = 1, the next 2¹ = 2, then 4, 8, 16 and so on. Multiply each bit by its place value and add:
decimal = bₙ × 2ⁿ + … + b₂ × 2² + b₁ × 2¹ + b₀ × 2⁰
Because each bit is 0 or 1, that boils down to: add the place values of the 1 bits and ignore the 0 bits.
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Those eight positions make one byte. The converter works with whole numbers of any length using JavaScript’s BigInt; a regular JavaScript number is exact only up to 2⁵³ − 1, which a 54-bit binary number already exceeds.
Worked examples
1011 → 11
1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 8 + 2 + 1 = 11.
11001000 → 200
The 1 bits sit at positions 7, 6 and 3: 128 + 64 + 8 = 200. In hex that’s C8: the left four bits (1100) are C and the right four (1000) are 8.
11111111 → 255
All eight bits are 1: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. A shortcut: a run of n ones is always 2ⁿ − 1, here 2⁸ − 1 = 256 − 1.
10000000000 → 1,024
A 1 followed by ten zeros is 2¹⁰ = 1,024, the “kibi” in kibibyte (KiB).
Why hex is easier to read than binary
Every group of four bits is exactly one hex digit, so long binary numbers are often written in hex instead:
| Binary | Hex | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0101 | 5 | 5 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1100 | C | 12 |
| 1111 | F | 15 |
So 1010 1010 is AA in hex and 170 in decimal (128 + 32 + 8 + 2).
Related guides
- Going the other way? The decimal to binary converter shows the repeated division by 2 and can pad to 8, 16, 32 or 64 bits.
- Converting hex instead? Use the hex to decimal converter.
- Bytes, kilobytes and kibibytes are all built on powers of 2 and 10: see the bytes to GB converter.
Frequently asked questions
How do you convert binary to decimal?
Write the powers of 2 under the bits, starting with 1 at the right (1, 2, 4, 8, 16 and so on), then add up the powers that sit under a 1. For example, 1011 = 8 + 2 + 1 = 11.
What is 11111111 in decimal?
255. Eight 1 bits add up to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, which is 2^8 − 1 and the largest value one byte can hold.
Do leading zeros change the value?
No. 00001011 and 1011 are both 11. Leading zeros only pad a number to a fixed width, such as 8 bits for a byte.
Does the converter handle negative binary numbers?
Binary input is read as a plain whole number: the leftmost bit is not treated as a sign bit, so 11111111 is 255, not −1. To see how a negative number is stored in two's complement, use the decimal to binary converter with a fixed bit width.
How long can the binary number be?
There is no practical limit. The converter uses JavaScript's BigInt, so 64-bit and longer values convert exactly.
Related guides

Free tool
Hex to Decimal Converter
Convert a hexadecimal number to decimal and see the working digit by digit. Binary and octal are shown too, for numbers of any length.
Free calculator

Free tool
Decimal to Binary Converter
Convert a decimal number to binary with the repeated division by 2 shown, pad it to 8, 16, 32 or 64 bits, and see negative numbers in two's complement.
Free calculator
Free Developer and PC Tools
Free formatters, decoders and converters for developers and PC users. Everything runs in your browser, and nothing you type is sent anywhere.
2 min read

Free tool
Bytes to GB Converter (GB and GiB)
Convert bytes, KB, MB, GB, TB and PB in decimal and binary units side by side, and see what size Windows will show for a drive.
Free calculator