String Base Converter
Convert numbers and strings between arbitrary custom bases and alphabets. Supports Binary, Hex, Base62, and custom character sets.
About
Data integrity relies on precise encoding. When moving values between different mathematical bases - such as converting a database ID to a URL-safe short code (Base62) or decoding a raw binary stream - standard calculators often fail due to precision limits. This tool uses BigInt logic to handle arbitrary-length integers, preventing the overflow errors common in standard floating-point arithmetic.
Unlike simple lookup tables, this converter performs a full mathematical radix transformation. It treats the input string as a number represented in the Source Base and recalculates its polynomial value before projecting it onto the Target Base. This is essential for generating cryptographically valid tokens, shortening UUIDs, or translating between esoteric counting systems.
Formulas
To convert a string from a source base S to a target base T, the tool first decodes the string into an integer N:
Where L is the length of the string and index returns the position of the character in the source alphabet.
Then, it encodes N into the target base T using the modulo operator:
This process repeats until N becomes 0.
Reference Data
| Base Name | Radix R | Alphabet / Character Set |
|---|---|---|
| Binary | 2 | 01 |
| Octal | 8 | 01234567 |
| Decimal | 10 | 0123456789 |
| Hexadecimal | 16 | 0123456789ABCDEF |
| Base36 | 36 | 0-9, A-Z (Case insensitive usually, but specific here) |
| Base58 (Bitcoin) | 58 | 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz |
| Base62 | 62 | 0-9, A-Z, a-z |