Binary to Decimal Converter

Convert binary to decimal, or convert between binary, decimal, octal and hexadecimal, with the working shown.

This binary to decimal converter turns a binary number into decimal and also shows the octal and hexadecimal equivalents. You can start from any of the four bases: binary, decimal, octal or hexadecimal. Enter the number, choose the base you are converting from, and the working is shown below the result.

To add, subtract, multiply or divide binary numbers instead, use the binary calculator. For the digits of a decimal number, the place value calculator shows what each digit is worth.

This calculator needs JavaScript. Please enable it in your browser.

How to convert binary to decimal

The place value method

Each binary digit is worth a power of 2, starting with 1 on the right. Multiply each digit by its power of 2 and add the results.

Position from the right01234567
Power of 21248163264128

Decimal = dₙ × 2ⁿ + … + d₁ × 2¹ + d₀ × 2⁰

Where each d is a binary digit, 0 or 1, and n is its position counted from the right starting at 0.

Decimal to binary by repeated division

Divide the number by 2 and record the remainder. Repeat with the quotient until it reaches 0, then read the remainders from the last one to the first.

Hexadecimal digits

Hexadecimal uses 16 digits. After 0 to 9, the letters A to F stand for 10 to 15.

LetterABCDEF
Value101112131415

Worked examples

Example 1: Binary 101101 to decimal

101101 = 1×2⁵ + 0×2⁴ + 1×2³ + 1×2² + 0×2¹ + 1×2⁰
= 32 + 0 + 8 + 4 + 0 + 1 = 45

The decimal value is 45. In octal it is 55 and in hexadecimal it is 2D.

Checking octal and hexadecimal

Group the binary digits in threes from the right for octal: 101 101 is 5 and 5, so 55. Group them in fours for hexadecimal: 0010 1101 is 2 and D (1101 is 13), so 2D.

Example 2: Decimal 45 to binary

45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1

Reading the remainders from the bottom up gives 101101.

Example 3: Decimal 255

255 in binary is 11111111, in octal it is 377, and in hexadecimal it is FF, because 15 × 16 + 15 = 255.

Example 4: Hexadecimal 1F

1F = 1 × 16 + 15 = 31

In binary, 31 is 11111, and in octal it is 37.

Frequently asked questions

How do you convert binary to decimal?

Multiply each binary digit by its power of 2, starting with 1 on the right, and add the results. For 101101 that is 32 + 8 + 4 + 1 = 45.

How do you convert decimal to binary?

Divide by 2 repeatedly and write down each remainder, then read the remainders from the last to the first. For 45 the result is 101101.

What do the letters in hexadecimal mean?

The letters A to F are the digits for 10 to 15, so F is 15 and 1F is 1 × 16 + 15 = 31.

Does the converter handle fractions or decimals with a point?

No. It converts whole numbers only, up to 64 digits.

Can it convert negative numbers?

Yes. A minus sign in front is kept, and the digits are converted as usual.