Binary to Decimal Tool Guide


Quick Reference

  • Binary: Uses digits 0-1 (e.g., 1010)
  • Octal: Uses digits 0-7 (e.g., 377)
  • Decimal: Uses digits 0-9 (e.g., 255)
  • Hexadecimal: Uses digits 0-9 and letters A-F (e.g., FF or ff)

How the conversion works

Despite the page name, this tool converts between any two of four number systems: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Internally it always routes through decimal as an intermediate step — your input is parsed into a decimal integer using JavaScript's parseInt(input, fromBase), then that decimal value is re-encoded into the target base with .toString(toBase).

Worked example: binary 1010 to decimal

Enter 1010 with "From" set to Binary and "To" set to Decimal. Reading the digits right to left, each position is a power of 2:

1010₂ = 1×2³ + 0×2² + 1×2¹ + 0×2⁰
      = 8 + 0 + 2 + 0
      = 10

The tool displays this as "1010 (base 2) → 10 (decimal) → 10 (base 10)" — the middle number is always the decimal intermediate, which in this case is also the final answer since the target base is decimal.

Going the other direction

To convert 10 back to binary, the tool repeatedly divides by 2 and reads the remainders bottom to top: 10÷2=5 r0, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1 → reading remainders upward gives 1010, confirming the round trip.

Input rules per base

Each base has a strict character set: binary accepts only 0-1, octal only 0-7, decimal only 0-9, and hexadecimal 0-9 plus A-F (case-insensitive). Entering a character outside that set — like "2" while Binary is selected — triggers a validation error rather than a silent wrong answer.

What it doesn't do

This converter only handles integers. There's no support for fractional binary values (like 10.5 in decimal) or negative-number sign conventions such as two's complement — for those you need a dedicated fixed-point converter.