Skip to content

Convert binary to decimal

Convert binary to decimal, hex and octal with the place-value expansion written out — 1011 = 8 + 2 + 1 = 11, shown for your own number.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
Binary → Decimal
Arbitrary precision: numbers larger than 2⁵³ are handled exactly using BigInt, so a 200-digit value converts without rounding.

Binary digits only. Grouping like 1010 1101 is fine.

Enter a value above. Binary, decimal, hexadecimal, octal and the full working appear here.

Place values, written out

Every position in a binary number is worth twice the one to its right. Add up the positions that hold a 1 and you have the decimal value. The formula block above does this with your own digits substituted, so you can copy the working rather than just the answer.

1 0 1 1 0 1
32 16  8  4  2  1
32  +  8 + 4  +  1 = 45

The doubling method

Faster for long numbers, and the method hardware effectively uses. Start at zero, then for each bit from the left: double what you have and add the bit.

101101
0×2 + 1 = 1
1×2 + 0 = 2
2×2 + 1 = 5
5×2 + 1 = 11
11×2 + 0 = 22
22×2 + 1 = 45

No powers to remember, and it scales to any length without a table.

Grouping in fours

Four bits is exactly one hex digit, which is why binary is conventionally grouped in nibbles. Once you know the sixteen four-bit patterns you can read any binary number by converting it to hex in your head and then to decimal if you still need to:

BitsHexDecBitsHexDec
000000100088
000111100199
0010221010A10
0011331011B11
0100441100C12
0101551101D13
0110661110E14
0111771111F15

Is that value signed or unsigned?

The bits alone cannot tell you. 11111111 is 255 as an unsigned byte and −1 as a signed one. The meaning comes entirely from the type the surrounding code declared. If you are chasing a bug where a value suddenly becomes a huge positive number, an unsigned reading of a negative value is a prime suspect — enter a minus sign here to see the two's complement pattern the hardware would have stored.

Where a stray binary value comes from

  • A permission or feature-flag bitmask printed for debugging.
  • A register value in a datasheet or a driver log.
  • A subnet mask, where 24 ones followed by 8 zeros is 255.255.255.0.
  • A logic-analyser or oscilloscope capture.
  • A puzzle, which is by far the most common reason people land on this page.

Precision

Conversion uses BigInt, so a 512-bit number converts exactly with no rounding. That matters more than it sounds: converters built on ordinary JavaScript numbers start producing wrong digits above 2⁵³, and they do it silently.

Questions

How do I convert binary to decimal by hand?

Give each digit a place value doubling from the right — 1, 2, 4, 8, 16 — then add the values wherever there is a 1. The tool prints that sum with your digits substituted.

Why is 1111 equal to 15 and not 16?

Because n ones give 2ⁿ − 1. Four ones are 8 + 4 + 2 + 1 = 15. The same rule is why a byte tops out at 255 and a 32-bit unsigned integer at 4,294,967,295.

Does the spacing in my input matter?

No. Spaces, commas and underscores are ignored, so 1010 1101 and 10101101 give the same answer. Grouping in fours simply makes long values readable.

What if my binary is a negative two’s complement value?

Read as written it is a large positive number. Prefix a minus sign to see the two’s complement panel, which shows the bit pattern that hardware would store for that negative value.