Binary Calculator

Convert whole numbers between binary, octal, decimal and hexadecimal in any direction, with the decimal value always shown to check against.

Result

Result (base 10)
10
Decimal value
10
Export:

How base conversion works

Every number can be written in any base by expressing it as a sum of powers of that base. The calculator first reads your value in the source base and converts it to a plain decimal number, then re-expresses that decimal in the target base.

Decimal acts as a common bridge between the two bases, which is why the decimal equivalent is always shown — it lets you verify each half of the conversion independently.

The four bases

The tool supports the four bases most common in computing and math. Each uses a fixed set of digits.

  • Binary (base 2) uses only 0 and 1, the language of digital circuits.
  • Octal (base 8) uses 0 to 7 and groups binary into threes.
  • Decimal (base 10) is the everyday number system.
  • Hexadecimal (base 16) uses 0 to 9 then A to F, and is shown in uppercase here.

Tips and common mistakes

Each base only accepts its own digits. A value like "1012" is invalid in binary because 2 is not a binary digit, and the calculator will flag it.

  • Hex digits A to F can be entered in either case; the result is uppercased.
  • This tool handles whole numbers only — fractions and decimal points are not supported.
  • If the result looks wrong, check the decimal value first to see which side of the conversion went astray.

Formula

decimal = parseInt(value, fromBase); output = decimal in toBase

Frequently asked questions

How do I convert binary to decimal by hand?
Multiply each digit by two raised to its position, counting from zero on the right, then add the results. So 1011 is 8 + 0 + 2 + 1 = 11.
What bases does this support?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16), in any direction. The decimal equivalent is always shown so you can sanity-check the conversion.
Can it convert fractions or negative numbers?
No — it handles whole, non-negative numbers only. Fractional binary and two’s-complement representations are outside its scope.