Base / Radix Converter
ConvertConvert integers between bases 2–62 with BigInt, so even very large numbers keep full precision.
- Decimal
On this page
What is a base / radix converter?#
Every integer is the same number; only its spelling changes with the base. 255 in decimal, ff in hexadecimal, 11111111 in binary, and 377 in octal are four strings for the exact same quantity. A radix converter translates one spelling into another — and the reason it deserves to be a real tool rather than parseInt is that JavaScript’s Number silently loses precision past 2^53 (about 16 decimal digits), so converting a 64-bit identifier like 18446744073709551616 with plain Number gives you a different number back without warning.
This page is BigInt-backed end to end, so an arbitrary-size integer keeps full precision through every conversion. It supports bases 2 through 62, using the canonical digit alphabet 0-9 then a-z then A-Z. As a convenience, base 2 through 36 are case-insensitive (you can type FF for hex 255), while bases 37 through 62 are case-sensitive — because in base 62, lowercase a and uppercase A are two genuinely different digits (10 and 36).
How to use it#
- Type the Value you want to convert. The page boots with
255. - Set From to the base your value is currently written in (dropdowns offer 2 through 62; default 10, decimal).
- Set To to the base you want (default 16, hexadecimal). The arrow between them is just a visual cue.
- The Output box shows the converted spelling live, and the Decimal row underneath shows the same value in base 10 — a handy sanity check when you are converting between two unfamiliar bases.
- Sample reloads the default, Clear empties the field. An invalid digit for the chosen base is reported in the status line (typing
8into base 8, orginto base 16, will not silently produce nonsense).
Key features#
- BigInt precision. Conversion runs on arbitrary-precision integers, so
2^64and larger round-trip exactly. There is no 2^53 cliff and no floating-point approximation. - Bases 2 through 62. Covers binary, octal, decimal, hex, base32, base36, base58-style alphabets, and full base62 — the range real systems actually use.
- Case-aware parsing. Bases 2–36 accept any case for convenience; bases 37–62 treat case as significant so
aandAstay distinct digits, matching the canonical 62-symbol alphabet. - Digit-group underscores tolerated. You can paste
1_000and it reads as1000— the same convention many programming languages use for readability. - Sign-aware. Negative values convert correctly; the minus sign is preserved through every base.
Worked example#
With the default 255, From 10, To 16, the panel shows:
Output: ff
Decimal: 255
Switch To to 2 and you get 11111111 — eight bits, the value that fits in exactly one byte, which is why ff is such a familiar sight in colour codes and byte dumps.
The real reason for BigInt shows up with a 64-bit value. Type 18446744073709551616 (which is 2^64), From 10, To 16:
Output: 10000000000000000
Decimal: 18446744073709551616
That is 1 followed by sixteen zeros — exactly 2^64 in hex. A converter built on JavaScript Number would have rounded the input to 18446744073709552000 before it even started, and you would never have noticed. Round-trip it back to From 16 / To 10 and the original decimal comes back unchanged, which is the test that proves no precision was lost.
FAQ#
Why does FF work for hex but not for base 62?#
Bases 2 through 36 share a single letter range (a–z, mapped to 10–35), so case does not matter and FF = ff = 255. From base 37 upward the alphabet needs more than 26 letters, so it extends into uppercase: a=10, b=11 … z=35, A=36, B=37 … Z=61. Once both cases are in use, a and A are different digits, so the parser must preserve case.
What happens if I type a digit that is invalid for the base?#
You get a clear error, not a wrong answer. Typing 8 or 9 with From set to 8 (octal), or g with From set to 16 (hex), is rejected because those characters are not legal digits in that base. The status line tells you the offending character.
Why does the tool show a Decimal row when I am converting to another base?#
Because decimal is the base humans reason in, so it is the natural sanity check. If you convert base-58 q to base-16 and see 1a, the Decimal row (26) lets you confirm “yes, the 58th-ish symbol really did mean twenty-six” without doing the arithmetic yourself.
Does it handle fractional numbers like 3.14?#
No — this converter works on integers only. Radix conversion of a fractional part is a different problem (it produces infinitely repeating expansions in most bases, the way 1/3 does in decimal), and silently truncating it would be misleading. For integer values of any size, conversion is exact and instantaneous.