Whole numbers only. Letters A–Z are digits 10–35.

Result

Enter your values and select Calculate to see the result.

How to use this calculator

  • Enter a whole number and choose the base it is written in.
  • The result shows it in binary, octal, decimal and hexadecimal. Enter another base in the last box for an extra conversion.
  • Prefixes such as 0x (hex), 0b (binary) and 0o (octal) are accepted. Letters A–Z represent digit values 10–35.

Formula

A number in base b with digits dₙ…d₁d₀ has the value dₙ × bⁿ + … + d₁ × b + d₀.

To convert to another base, the value is repeatedly divided by the new base and the remainders are read in reverse order. Arbitrary-precision integers keep every digit exact.

Worked example

255 in other bases

255 = 15 × 16 + 15, so in hexadecimal it is FF. In binary it is 1111 1111 and in octal 377.

Hex to decimal

1A3 in base 16 = 1 × 256 + 10 × 16 + 3 = 419.

Assumptions and limitations

  • Whole numbers only; fractional parts are not converted.
  • Negative numbers are shown with a minus sign, not in two’s complement form.
  • Input is limited to 256 digits.

Frequently asked questions

Why do programmers use hexadecimal?

Each hex digit represents exactly four binary digits, so long binary values such as colours (#FF8800) and memory addresses are much shorter to write.

What is the largest base supported?

Base 36, which uses the digits 0–9 and all 26 letters.