Binary to Decimal Converter

Type a binary number made of 0s and 1s and get its decimal value at once, plus the hexadecimal and octal equivalents.

How to use it

Type or paste a binary number into the field. Spaces and underscores are ignored, so you can write 1010 1100 or 1010_1100. The conversion updates as you type, and the button is there if you prefer to press it.

Only the digits 0 and 1 are valid. If you type any other character, you will see a message. Whole numbers up to 4096 digits are supported without losing precision.

How it is calculated

Binary is a place-value system in base 2. Starting from the right, the digits stand for 1, 2, 4, 8, 16 and so on, which are powers of two. The decimal value is the sum of the powers of two wherever the digit is 1.

The tool uses arbitrary-precision integers, so long strings convert exactly. Hexadecimal and octal are produced from the same value, with each hex digit representing four binary digits.

Examples

1101 has ones in the 8, 4 and 1 places, so 8 + 4 + 1 = 13. In hexadecimal that is D.

101010 is 32 + 8 + 2 = 42, which is 2A in hexadecimal and 52 in octal. The byte 11111111 equals 255.

FAQ

How do I convert binary to decimal by hand?

Write the powers of two under each digit from the right, then add the ones where the digit is 1.

Does it handle negative or fractional binary?

No. It converts unsigned whole numbers only, without a sign or binary point.

What does a leading zero change?

Nothing in the value. 0011 and 11 are both 3.

What is the largest number I can enter?

Up to 4096 binary digits, far beyond the 64-bit limit of many programs.

See also

Quick online tool: BMI Calculator.
Related calculator: Age Calculator.
More tools: Days Between Dates.
Another free tool: Percentage Calculator.
Also handy: Tip Calculator.

More free tools