Calculator

Number base converter

Convert a whole number between any two bases from 2 to 36, including binary, octal, decimal and hexadecimal.

  • No account needed
  • Nothing leaves your browser
  • Works offline

What is in here

7topics
534problems
54formulas
60proof tasks
0 learned0 saved0 practice attempts0% accuracy0 proof checks

Calculators

Discrete math tools

Six calculators that run entirely in this browser. Inputs are validated, so a rejected entry says what is wrong instead of returning a confident wrong answer.

Representation

Base converter

Rewrite an integer in any base from 2 to 36, with the decimal value shown alongside.

Digits run 0-9 then a-z. A leading minus sign is kept.

Try
base 10255 base 10
255
base 16255 base 10
FF

About the number base converter

A base, or radix, is how many digits a positional numeral system uses. Base 2 uses 0 and 1, base 10 uses 0 to 9, and base 16 adds A to F for the values ten to fifteen. The same quantity has a different spelling in each: 255 in base 10 is 11111111 in base 2 and FF in base 16.

Enter the value, the base it is written in and the base you want. Letter digits are accepted in either case, and a leading minus sign is preserved. Any digit that does not exist in the source base is rejected with a message rather than silently dropped, so a typo cannot become a confident wrong answer.

Conversion runs in arbitrary precision integers, so a full 64-bit hexadecimal value converts exactly instead of losing digits past 2 to the power of 53. Fractional values are not supported: this converter is for whole numbers, and it says so rather than treating the decimal point as an invalid digit.

Worked example

Worked example

InputValue FF, from base 16, to base 2
ResultFF base 16 = 255 base 10 = 11111111 base 2

Each hexadecimal digit maps onto exactly four binary digits, which is why hex is used as shorthand for binary.

Questions

Frequently asked

How do I convert hexadecimal to binary?

Enter the value with 16 as the source base and 2 as the target base. By hand, replace each hexadecimal digit with its four binary digits: F becomes 1111, so FF becomes 11111111.

Which bases does the converter support?

Any base from 2 to 36 in either direction. Base 36 is the limit because it uses the ten digits plus the twenty-six letters of the alphabet, and there is no standard digit after z.

Can it convert decimals or fractions?

No. The converter handles whole numbers only, and rejects a value containing a decimal point with a message saying so. Negative whole numbers are fine and keep their sign.