Arbitrary Base Converter

Enter your number and pick the source and target bases to convert.

Result

110100111
423
base 16 to base 2

How it is calculated

Enter an integer, the base it is written in (2 to 36) and the base you want (2 to 36). Digits above 9 are the letters a to z, where a = 10, b = 11 and z = 35, and upper or lower case is accepted. The tool reads the value digit by digit in the source base:

decimal = decimal × from + digit

and then divides that decimal number repeatedly by the target base, collecting the remainders as digits from the last to the first. Both steps use exact string arithmetic, so very long numbers are not rounded. A leading minus or plus sign is allowed. The result is shown in lower case together with its decimal value (without sign) and a label naming the bases. Any digit that is not valid in the source base, a fraction point, spaces inside the number, a prefix such as 0x or a base outside 2 to 36 gives no result.

Worked example

Convert the hexadecimal number 1a7 (base 16) to binary (base 2).

  1. Read the digits: 1 = 1, a = 10, 7 = 7.
  2. Decimal value: ((1 × 16) + 10) × 16 + 7 = 26 × 16 + 7 = 423.
  3. Divide 423 by 2 repeatedly and note the remainders: 423, 211, 105, 52, 26, 13, 6, 3, 1 gives remainders 1, 1, 1, 0, 0, 1, 0, 1, 1.
  4. Read them from last to first: 110100111.

The tool shows 110100111 with a decimal value of 423.

Try this example →

Common mistakes

  • Entering a digit that does not exist in the source base. A 2 in base 2 or a g in base 16 is invalid, and the tool returns nothing rather than guessing.
  • Typing a prefix like 0x1a7 or a suffix such as 1a7h. Only the plain digits are accepted, so remove the prefix and put the base in the From field.
  • Entering a number with a fraction point, like 10.5. The converter handles whole numbers only.
  • Confusing the From and To fields. Swapping them reads your number in the wrong base, and 1a7 as a base 2 number is invalid.
  • Treating the decimal line as signed. For a negative input the converted value keeps the minus sign, but the decimal line shows the size alone, so read the sign from the main result.

About this calculator

Every positional number system — binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16) — represents the same quantity using a different set of digit symbols and place values. This converter generalizes that idea to any base from 2 to 36, using digits 0-9 and letters a-z to represent values up to 35 in a single digit position (base 36 is the practical ceiling since the Latin alphabet only has 26 letters).

It works by converting the input to a decimal intermediate value, then repeatedly dividing by the target base to build up the output digits. It's a handy tool for programmers, computer science students, and puzzle solvers who need conversions beyond the usual binary/octal/hex trio — base 36 in particular shows up in URL shorteners and compact ID encoding schemes.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Base 36 is handy for short IDs, and the tool shows how many characters you need: zz is 1,295, so two characters cover 0 to 1,295 and three cover up to 46,655. Enter 46655 with from 10 and to 36 and you get zzz. Which bases do you use most, and would custom digit sets such as base 58 be useful to you?

Popular calculators

All Calculators