Developer tools

Binary to Decimal Converter

Binary to Decimal Converter

Convert binary numbers to decimal exactly, of any length, with two's complement for signed values.

About this tool

About Binary to Decimal Converter

Paste a string of 0s and 1s into the Binary row and the decimal value appears below it as you type, along with octal, hexadecimal and base 36. Spaces, underscores and a 0b prefix are accepted, so you can paste a byte grouped as 1010 1100 or a literal straight from code. The conversion is exact for any length, so a 64-bit or 128-bit pattern does not lose its last digits the way it can in a spreadsheet. If the binary is really a signed value, for example a register dump or a byte from a sensor, open the Two's complement panel, choose 8, 16, 32 or 64 bits, and read the signed and unsigned decimal side by side. A wrong digit such as a 2 is pointed out by position. You can also edit the decimal row to go back to binary, so the page doubles as a decimal to binary converter.

Built and maintained by Abhi JainUpdated

How to Convert Binary to Decimal

  1. 1

    Enter the binary number

    Type or paste it into the Binary row. Spaces, underscores and a 0b prefix are fine.

  2. 2

    Read the decimal

    The Decimal row updates instantly. Use the Two's complement panel with a Bit width for signed values.

Binary to Decimal Converter: questions and answers

How do you convert binary to decimal?

Write the powers of 2 under each digit from the right (1, 2, 4, 8, 16…) and add the ones where the digit is 1. For 101101: 32 + 8 + 4 + 1 = 45.

What is 11111111 in decimal?

255 as an unsigned 8-bit number (2^8 − 1). Read as a signed 8-bit two's complement value it is −1.

How do I convert a negative binary number?

If the binary uses two's complement, choose its bit width. When the top bit is 1, the signed value is the unsigned value minus 2^n, so 11110110 in 8 bits is 246 − 256 = −10.

Can I convert binary fractions like 0.101?

No, this converter handles whole numbers only, exactly. For 0.101, add the negative powers of two by hand: 0.5 + 0.125 = 0.625.