Binary to Decimal Converter
Type 1s and 0s. You get the decimal value and the sum of powers of 2 behind it.
https://flxcode.com/binary-to-decimal/
Example
11010110 in base 2 (binary) is 214 in base 10 (decimal).
Steps
- Each digit is worth its value times a power of 2: 11010110 = 1 × 2⁷ + 1 × 2⁶ + 0 × 2⁵ + 1 × 2⁴ + 0 × 2³ + 1 × 2² + 1 × 2¹ + 0 × 2⁰ = 214.
The same number in the common bases
| Base | Value |
|---|---|
| base 2 (binary) | 1101 0110 |
| base 8 (octal) | 326 |
| base 10 (decimal) | 214 |
| base 16 (hexadecimal) | D6 |
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Worked examples
| Binary | Decimal | Note |
|---|---|---|
| 1101 | 13 | Eight + four + one |
| 11010110 | 214 | A full byte |
| 1111 1111 | 255 | Spaces between nibbles are fine |
| 1 0000 0000 | 256 | A 1 followed by 8 zeros is 2⁸ |
| 101.101 | 5.625 | After the point: halves, quarters, eighths |
| 0b1010 | 10 | The 0b prefix is accepted |
The doubling method
Start at 0. For every bit from the left, double the total and add the bit. For 1101: 0 → 1 → 3 → 6 → 13. It needs no table, and it is how the tool reads long numbers: one multiply and one add per bit.
Powers of two
2⁰ = 1, 2¹ = 2, 2² = 4, 2³ = 8, 2⁴ = 16, 2⁵ = 32, 2⁶ = 64, 2⁷ = 128, 2⁸ = 256, 2⁹ = 512, 2¹⁰ = 1024, 2¹¹ = 2048.
Memorize these up to 2¹⁰ = 1024. Most binary maths you meet is made of them.
Unsigned or signed
Bits do not say whether they are a negative number. This converter reads them as an unsigned value. A byte 11111110 is 254 unsigned and -2 as a signed byte. If you want the other direction, the decimal to binary converter lists the two's complement patterns for a negative number. For hexadecimal there is hex to decimal, and the number base converter covers every base up to 36.
Numbers this uses
- Digits 0 and 1. Spaces and underscores inside the number are ignored. A 0b prefix is accepted.
- Up to 1,000 characters, exact (BigInt). Place values after a point are 2⁻¹, 2⁻², and so on.
- The answer is unsigned. A minus sign in front gives a negative decimal, not a two's complement reading.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
How do I convert binary to decimal by hand?
Write the place values under the bits from the right: 1, 2, 4, 8, 16 and so on. Add up the ones that sit under a 1. For 1101 that is 8 + 4 + 1 = 13. You can also double as you go: start at 0, and for each bit from the left, double the total and add the bit.
Does it accept spaces and long numbers?
Yes. 1111 0000 works the same as 11110000, and underscores are ignored too. Up to 1,000 digits are exact, so a 64-bit value converts without the rounding you would get from a calculator that uses floating point.
How do I know how many bits I have?
Count the digits. 8 bits is one byte and can hold 0 to 255. n bits can hold 2ⁿ different values, which is 0 to 2ⁿ − 1 when read as unsigned. The reference table of powers above goes up to 2¹¹.
What does a leading 1 mean in a signed number?
In two's complement, a byte that starts with 1 is negative. This tool gives the unsigned value, so 11111110 shows as 254. As a signed byte it is 254 − 256 = -2. For other widths subtract 2 to the power of the number of bits.
Can binary have a point, like 101.101?
Yes. Places after the point are 1/2, 1/4, 1/8 and so on. 101.101 is 4 + 1 + 1/2 + 1/8 = 5.625. Binary fractions end only when the decimal value is a fraction with a power of two at the bottom, like 0.625 = 5/8.
What is an IPv4 address in binary?
Four bytes, each written as 8 bits. 11000000.10101000.00000001.00000001 is 192.168.1.1 once each byte is converted. Paste the groups one at a time.
Why does it say a digit is not valid?
Binary has only 0 and 1. A 2 or a letter means the number is in another base, such as decimal or hex. Switch the From base to the right one, or use the number base converter that has all of them.
Is the binary number I type saved or sent anywhere?
No. The conversion runs in your browser. What you type is not put in the address bar, not stored and not counted. We only count the base you converted to.
More from FLXCode
Number Base ConverterNew
Convert any number between bases 2 and 36, exact with BigInt. Negative and fractional input, bits grouped by 4.
Decimal to Binary ConverterNew
Turn decimal into binary with the divide-by-2 steps, bits grouped by 4, and negative numbers in two's complement.
Hex to Decimal ConverterNew
Turn hexadecimal into decimal, with the place values worked out. Also binary, octal and bases up to 36.
Long Division CalculatorNew
Long division laid out like on paper, with the remainder and the decimal, repeating part marked.