Binary Calculator

Convert whole numbers between binary, octal, decimal and hexadecimal.

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