User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
0 characters
Decimal
Hexadecimal
Presets:
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Incorrect base conversion is a common source of off-by-one errors in protocol design, memory addressing, and cryptographic implementations. A single misinterpreted nibble in a hexadecimal MAC address or an IPv6 prefix renders the entire address invalid. This tool converts integer and fractional values between any radix from 2 (binary) to 64 (Base64 alphabet) using arbitrary-precision arithmetic via JavaScript BigInt internally. It does not truncate or round integer parts regardless of magnitude.

Fractional conversion uses the repeated-multiplication method, producing up to 32 fractional digits in the target base. Note: most fractional values that terminate in one base produce non-terminating expansions in another (e.g., 0.1 in base 10 is repeating in base 2). The tool truncates after 32 digits without rounding. For bases above 36, the extended alphabet uses lowercase letters followed by + and /, matching the RFC 4648 Base64 alphabet order.

base converter number system binary hexadecimal octal radix base64 number converter

Formulas

Integer conversion from base b1 to base b2 proceeds in two stages: decode then encode.

decode: N = nโˆ’1โˆ‘i=0 di โ‹… b1i

where di is the digit value at position i (rightmost = 0), and n is the digit count. This yields the internal integer N.

encode: repeat { r = N mod b2 ; N = โŒŠN รท b2โŒ‹ } until N = 0

Remainders r collected in reverse order form the output digits.

For fractional parts, the repeated-multiplication algorithm applies:

f = fractional value in R ; repeat { f = f ร— b2 ; digit = โŒŠfโŒ‹ ; f = f โˆ’ digit } up to 32 digits

Where b1 = source radix, b2 = target radix, N = decoded integer value, di = digit value at position i, r = remainder, f = fractional component.

Reference Data

BaseNameDigit SetCommon UseExample (25510)
2Binary0-1CPU registers, bitfields11111111
3Ternary0-2Balanced ternary logic100110
4Quaternary0-3DNA encoding (Aโ€‰Cโ€‰Gโ€‰T)3333
5Quinary0-4Tally systems2010
6Senary0-5Dice probability1103
7Septenary0-6Week-day numbering513
8Octal0-7Unix file permissions (chmod)377
10Decimal0-9Human arithmetic255
12Duodecimal0-9, A - BTimekeeping (12 hours, 12 months)193
16Hexadecimal0-9, A - FMemory addresses, color codesFF
20Vigesimal0-9, A - JMaya numeral systemCF
32Base320-9, A - VCrockford encoding, TOTP secrets7V
36Base360-9, A - ZURL shorteners, compact IDs73
58Base58Alphanumeric (no 0OIl)Bitcoin addresses5Q
62Base620-9, A - Z, a - zShort URL tokens47
64Base640-9, A - Z, a - z, +, /MIME encoding, data URIs3/

Frequently Asked Questions

A fraction terminates in base b only if its denominator's prime factors are all factors of b. Decimal 0.1 equals 110, and 10 = 2 ร— 5. Binary (base 2) cannot represent the factor 5, so the expansion repeats: 0.0001100110011...2. This tool truncates at 32 fractional digits.
Bases 2 - 10 use digits 0 - 9. Bases 11 - 36 append uppercase A - Z (case-insensitive on input). Bases 37 - 62 further append lowercase a - z (case-sensitive). Bases 63 - 64 add + and /, following the RFC 4648 Base64 alphabet. Input for bases โ‰ค 36 is always case-insensitive.
The converter uses JavaScript BigInt internally, which supports arbitrary-precision integers limited only by available memory. In practice, inputs of several thousand digits convert within milliseconds. Fractional parts use IEEE 754 double-precision floating point after decoding, so precision is limited to roughly 15 - 17 significant decimal digits for the fractional component.
MIME Base64 (RFC 2045) encodes raw byte streams into printable ASCII using a 6-bit grouping scheme with padding (=). This tool performs mathematical radix conversion: it treats the input as a positional number in base b1 and re-expresses it in base 64. The digit alphabet matches RFC 4648, but the operation is arithmetic, not byte-stream encoding. The results differ for the same input string.
The converter strips a leading minus sign, converts the absolute value, then prepends the minus sign to the result. It does not use two's complement or any fixed-width signed representation. If you need two's complement output, convert the positive magnitude to binary and apply the complement manually for your target bit width.
Yes. Separate the integer and fractional parts at the radix point (.). The integer part converts via BigInt with exact precision. The fractional part converts via repeated multiplication, yielding up to 32 output digits. Because this method uses floating-point intermediate values, cumulative rounding may affect the last 1 - 2 digits for very long fractional inputs.