Binary to Decimal Converter

1×2⁵32=32
0×2⁴16=0
1×8=8
1×4=4
0×2=0
1×2⁰1=1
total=45

Show the working for decimal → binary

Going the other way? Convert decimal back to binary

How do you convert binary to decimal?

Binary to decimal conversion gives each digit the weight of its position, multiplies the digit by that weight, and adds the products together.

In short

Binary 101101 equals decimal 45. Multiply each bit by its power of two from the right (1, 2, 4, 8, 16, 32) and add the products: 32 + 8 + 4 + 1 = 45.

  1. Number the positions from the right, starting at 0.
  2. Give each position the weight 2ⁿ, so the rightmost digit is worth 1.
  3. Multiply every digit by its weight and add the products.
  4. The total is the decimal value: 101101 = 45.

Binary to Decimal Conversion Table

Every position in a binary number is worth twice the one to its right. Binary writes values on the digit set 0, 1, each place worth 2ⁿ, and a value marked with the 0b prefix is binary. A byte is 8 bits and holds 256 values, 0–255; a nibble is 4 bits. Add the weights under the 1s and you have the decimal value; divide by 2 and keep remainders to go the other way.

Binary to Decimal Conversion Table
PositionWeightValue
152^1532768
142^1416384
132^138192
122^124096
112^112048
102^101024
92^9512
82^8256
72^7128
62^664
52^532
42^416
32^38
22^24
12^12
02^01

Each base is defined by three things: which digits it uses, how a value is marked, and what each position is worth.

Base reference
BaseRadixDigits PrefixPlace worthTypical range
Binary20, 1 0b2ⁿ8-bit byte 0–255 (00000000–11111111); 4-bit nibble 0–15; 16/32/64-bit words
Decimal100–9 none10ⁿany; decimal pages treat 0–255 as the byte range

Worked Example: 101101 to Decimal

One value, converted the long way so the working is visible. This is the same grid the converter shows when you turn on "show steps".

1×2⁵32=32
0×2⁴16=0
1×8=8
1×4=4
0×2=0
1×2⁰1=1
total=45

Result: 101101 = 45

Number the positions from the right, starting at 0. Each position is worth 2 raised to that number, so the rightmost digit is worth 1, the next 2, the next 4, and so on up the value.

That turns 101101 into 1 x 2^5 + 0 x 2^4 + 1 x 2^3 + 1 x 2^2 + 0 x 2^1 + 1 x 2^0, which adds up to 45. Digits that are 0 contribute nothing and can be skipped, but the position still counts — dropping a zero shifts every digit to its left and changes the value. This is the same expansion decimal itself uses; only the base in the weights differs.

Check it in reverse

The value returns unchanged. Convert 45 back and you get 101101, because a base change rewrites the digits without touching the quantity they stand for. That is the whole test: if the round trip differs, a digit was misread. To check it by hand, convert the binary result back to decimal and compare it with the number you started from.

Worked examples: binary to decimal

Each example gives the value first, then the working. Click a value to load it in the converter.

What is 0b11111111 in decimal?

0b11111111 in binary is 255 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b101010 in decimal?

0b101010 in binary is 42 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b10101 in decimal?

0b10101 in binary is 21 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b101 in decimal?

0b101 in binary is 5 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b10011100 in decimal?

0b10011100 in binary is 156 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b101101 in decimal?

0b101101 in binary is 45 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b11111011 in decimal?

0b11111011 in binary is 251 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b1010 in decimal?

0b1010 in binary is 10 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b1100100 in decimal?

0b1100100 in binary is 100 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b1000 in decimal?

0b1000 in binary is 8 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b10000 in decimal?

0b10000 in binary is 16 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b100000 in decimal?

0b100000 in binary is 32 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b1000000 in decimal?

0b1000000 in binary is 64 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b10000000 in decimal?

0b10000000 in binary is 128 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b1100 in decimal?

0b1100 in binary is 12 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b1111 in decimal?

0b1111 in binary is 15 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b10100 in decimal?

0b10100 in binary is 20 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b11001 in decimal?

0b11001 in binary is 25 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b110010 in decimal?

0b110010 in binary is 50 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0b11001000 in decimal?

0b11001000 in binary is 200 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

Every example above reverses exactly — divide the same value down to bits.

What About Padding, Fractions and Width?

Leading zeros and width

A number carries no leading zeros unless a width is fixed. 45 and 045 are the same value, so the converter writes the short form. Fixed widths belong to bytes and registers, not to arithmetic. how to write a negative number in binary covers where width does matter.

Fractions and the point

Digits after a point convert by the same rule with negative powers, so the first place after the point is worth 1/10. Many fractions that end neatly in decimal repeat forever in binary, which is where rounding creeps in.

Negative values

A minus sign is kept in front of the digits. Fixed-width binary encodes sign differently, using two's complement, and that is a separate rule from the base change itself.

How large a value can be

The method has no ceiling; each extra binary digit multiplies the range by 2. Practical limits come from the width a machine stores the value in, not from the conversion.

Binary to Decimal in Code

The same rule in one line. Both read the digits and return the decimal total.

Python: int('101101', 2)
JavaScript: parseInt('101101', 2)

Common Mistakes

Frequently Asked Questions

Do leading zeros change a binary number's value?

No. A zero on the left carries no weight, so 101101 and 00101101 are both 45. Leading zeros matter only when a width is fixed, such as writing every value as a full 8-bit byte.

Why does 11111011 mean -5 in some contexts and 251 in others?

The same 8 bits are read under two rules. Unsigned, 11111011 is 251; as 8-bit two's complement it is −5. 11111111 is 255 as an unsigned 8-bit number (0xFF, 0o377). Read as 8-bit two's complement it is −1; the 8-bit signed range is −128 to 127.

How do you convert a binary fraction like 101.11 to decimal?

101.11 is 5.75. The digits left of the point keep the weights 4, 2 and 1, and the digits right of it take 1/2 and 1/4, so 4 + 1 + 0.5 + 0.25 = 5.75.

What is the largest number 8 bits can hold?

255, with the bits read as unsigned. A byte is 8 bits and holds 256 values, 0–255; a nibble is 4 bits. Every bit set gives 11111111, which is 255 in decimal and FF in hex. Why 8 bits became the unit is covered in binary code explained from the alphabet up.

A base change is reversible, so the same value converts straight back in the decimal to binary direction.

The rest of the family sits on binary, octal, decimal and hex converters.