Skip to content
Free developer tool

Integer base converter

This base converter changes a whole number from one number base to another, such as hexadecimal ff to decimal 255. Programmers and students use it for binary, octal, decimal and hex work, and for bases up to 36 that use letters as digits.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result
Private: runs on this device

Input

2 characters

Result

255

Example

Input
ff
Result
255

How to use the integer base converter

  1. Type a whole number such as ff or -1010 into the Whole number box.
  2. Set Input base, 2 to 36 and Output base, 2 to 36. The defaults are 16 and 10.
  3. Choose Output letters: Lowercase or Uppercase.
  4. Press Run, then Copy result or Download the converted number.

How it works

Numbers are handled as exact big integers, so long values convert without rounding. Up to 4096 digits are accepted.

A leading + or - sign is allowed, and negative results keep their minus sign.

A 0x prefix is accepted only when the input base is 16, 0o only for base 8, and 0b only for base 2.

Fractions, decimal points, spaces and underscores are rejected, as is any digit too large for the input base, such as 2 in binary.

Letters a to z stand for digit values 10 to 35, and input letters can be in either case.

Everything runs in your browser. Your input is not uploaded or stored.

Questions and answers

How do I convert hex to decimal?

Leave Input base at 16 and Output base at 10, type the hex value, and press Run.

Does it support negative numbers?

Yes. Type a minus sign in front. The result is shown with a minus sign, not as two's complement bits.

Can I convert decimals or fractions?

No. This tool converts whole numbers only and rejects a decimal point.

Why would anyone use base 36?

Base 36 uses all ten digits and all 26 letters, so it writes large numbers in few characters. It is sometimes used for short IDs.

All 100 SnowRock tools