Binary to Decimal Converter – Free

This binary to decimal converter reads a base-2 whole number and returns its base-10 value. Long inputs are converted exactly, with no rounding past 53 or 64 bits.

How to use the Binary to Decimal tool

  1. Enter the bits in the Base-2 number box, for example 101101. Do not separate them with spaces.
  2. Select Convert to calculate the decimal value.
  3. Read the base-10 number in the Result box.
  4. Select Copy to take the number, or Example to convert the sample and see 45.

How binary to decimal conversion works

Each binary position is worth twice the one to its right: 1, 2, 4, 8, 16, 32 and so on. The decimal value is the sum of the weights where the bit is 1. For 101101 the 1 bits sit at 32, 8, 4 and 1, and 32 + 8 + 4 + 1 = 45.

There is a second method that needs no table of powers, and it is the one this tool uses internally. Start with zero and read the bits from left to right. For every bit, double the running total and add the bit. The total after the last bit is the answer.

Worked example with the doubling method

Reading 101101 from the left, the running total goes 1, then 2, then 5, then 11, then 22, then 45. Each step is the previous total times two, plus the next bit. The method works for any length and is easy to do in your head.

101101  ->  45
11111111  ->  255
1111111111111111  ->  65535
-101101  ->  -45
0b101101  ->  45

Exact results for big numbers

Many quick conversions in JavaScript or a spreadsheet pass through a 64-bit floating point number, which is only exact up to 2^53 - 1, or 9,007,199,254,740,991. Past that point the low digits are silently rounded.

This converter uses arbitrary-precision integers. A 1 followed by 64 zeros returns 18446744073709551616, every digit correct. The input can be up to 4,096 characters, which allows values with more than 1,200 decimal digits.

Signs, prefixes and things that are rejected

A minus sign in front of the bits makes the value negative. The tool does not treat a leading 1 as a sign bit, so 11010011 is 211, not -45. To read a pattern as a two's complement integer, use the Binary Signed unsigned Converter.

  • A 0b prefix is allowed, in either letter case.
  • Leading zeros are fine and do not change the value.
  • Spaces inside the number are rejected. Remove grouping before you convert.
  • A binary point is rejected. Only whole numbers are supported.
  • A plus sign, the digits 2 to 9 and letters are reported as Invalid base-2 digit.

Frequently asked questions

How do I convert binary to decimal by hand?

Write the powers of two above the bits, starting with 1 on the right. Add the powers that sit above a 1. For 1101 that is 8 + 4 + 1 = 13.

What is the largest binary number this tool can convert?

The input may be up to 4,096 characters, so a number of about four thousand bits. The result is exact and can be more than 1,200 digits long.

Does the converter understand two's complement?

No. It reads the bits as a plain magnitude and only a minus sign makes the value negative. An 8-bit pattern such as 11111111 returns 255, not -1.

Can it convert binary fractions such as 101.1?

No. The point is not a valid base-2 digit for this tool, so the input is rejected. Convert the whole part and the fractional part separately if you need a fraction.

Why are spaces not allowed in the number?

The parser checks every character after trimming the ends, and a space is not 0 or 1. Join the groups together first. 1010 1010 must be entered as 10101010.

Do leading zeros change the decimal result?

No. Zeros on the left add nothing to the sum, so 0000101101 and 101101 both give 45.

Related tools