Change Integer Base
Convert integers between any bases from 2 to 36. Supports binary, octal, decimal, hexadecimal, and custom radix conversions instantly.
About
Positional numeral systems encode integer values using a fixed set of digits weighted by powers of a radix r. Converting between bases requires decomposing the source representation into its canonical value, then re-encoding under the target radix. Errors in manual conversion compound quickly: a single misidentified digit in base-16 can shift the result by 16k, where k is the digit position. This tool performs exact arbitrary-precision conversion for any integer across bases 2 through 36, using the standard alphanumeric digit set (0 - 9, A - Z). It handles negative values and numbers of arbitrary length without floating-point truncation.
Note: this tool operates on integers only. Fractional base conversion introduces repeating-digit edge cases that require separate treatment. Results are exact; no rounding or approximation is applied.
Formulas
An integer N represented in base r with digits dk has the canonical value:
To convert from base r1 to base r2, first evaluate the sum above to obtain the canonical integer, then extract digits in base r2 via repeated division:
Digits are collected least-significant first and reversed to produce the final representation.
Where: N = integer value, r = radix (base), dk = digit at position k, n = total number of digits.
Reference Data
| Base | Name | Digits Used | Common Use | Example: 25510 |
|---|---|---|---|---|
| 2 | Binary | 0-1 | Digital logic, CPU instructions | 11111111 |
| 3 | Ternary | 0-2 | Balanced ternary computing | 100110 |
| 4 | Quaternary | 0-3 | DNA nucleotide encoding | 3333 |
| 5 | Quinary | 0-4 | Tally systems | 2010 |
| 6 | Senary | 0-5 | Dice arithmetic | 1103 |
| 7 | Septenary | 0-6 | Week-day calculations | 513 |
| 8 | Octal | 0-7 | Unix file permissions, PDP-11 | 377 |
| 10 | Decimal | 0-9 | Everyday arithmetic | 255 |
| 12 | Duodecimal | 0-9, A - B | Time (12 hours), imperial units | 193 |
| 16 | Hexadecimal | 0-9, A - F | Memory addresses, CSS colors | FF |
| 20 | Vigesimal | 0-9, A - J | Maya and Aztec numeral systems | CF |
| 32 | Duotrigesimal | 0-9, A - V | Crockford Base32 encoding | 7V |
| 36 | Hexatrigesimal | 0-9, A - Z | URL shorteners, compact IDs | 73 |