Integer Base Changer

Parses a single integer string in a chosen "from" base (2-36) and re-renders it in a chosen "to" base (2-36), using digits 0-9 then lowercase a-z for values above 9. Invalid digits for the given from-base are rejected. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

This tool converts a single integer written in one number base into its equivalent representation in a different base, supporting any base from 2 through 36.

It generalizes the more specific binary/octal/hex converters in this category into one flexible tool for any radix pairing.

What Is Integer Base Changer?

A converter that takes one integer string, a "from" base, and a "to" base, and outputs the same value re-rendered in the target base.

Digits above 9 use lowercase letters a through z, following the standard convention for bases beyond 10 (like hexadecimal's a-f).

How Integer Base Changer Works

The input string is stripped of an optional leading "-" sign, and each remaining character is checked against the from-base's valid digit set.

Those digits are accumulated into a BigInt value by repeatedly multiplying by the from-base and adding each digit's value.

That BigInt magnitude is then repeatedly divided by the to-base, collecting remainders as digits (using letters for values above 9) until it reaches zero, with the sign reapplied at the end.

When To Use Integer Base Changer

Use it whenever you need to convert between two specific, possibly unusual bases, like base 7 to base 20, rather than one of the common binary/octal/hex pairs.

It's also useful for teaching positional number systems in bases other than the common ones.

Features

Advantages

  • Supports any base from 2 to 36 in either direction, not just the common binary/octal/hex/decimal set.
  • Uses BigInt internally so very large numbers convert without losing precision.

Limitations

  • Only supports a single integer value per conversion, not a list.
  • Limited to bases 2 through 36, the range representable with digits 0-9 and letters a-z.

Examples

Decimal to hex

Input

255, from base: 10, to base: 16

Output

ff

255 in base 10 is the same value as "ff" in base 16.

Base 36 to binary

Input

z, from base: 36, to base: 2

Output

100011

The single base-36 digit "z" has the value 35, which is "100011" in binary.

Best Practices & Notes

Best Practices

  • Double-check which value is the "from" base and which is the "to" base before converting, since swapping them gives a completely different (and likely invalid) result.

Developer Notes

Uses `BigInt` throughout the accumulation and re-expansion steps (rather than plain `Number`) specifically so large values in unusual bases don't silently lose precision the way floating-point arithmetic would.

Integer Base Changer Use Cases

  • Converting between two uncommon bases directly, without an intermediate decimal step
  • Teaching or exploring positional number systems beyond binary/octal/hex/decimal
  • Checking manual base-conversion homework or puzzles

Common Mistakes

  • Entering a digit that's invalid for the chosen from-base, such as "g" with a from-base of 16.
  • Mixing up the from-base and to-base fields.

Tips

  • For the common bases (2, 8, 16), the dedicated Integer to Binary/Octal/Hex Converters may be more convenient since they work on a full list at once.

References

Frequently Asked Questions