base-converter

Type a number in binary, octal, decimal, or hexadecimal and see it instantly converted to all four bases at once. Built on BigInt, so full 64-bit values (like a C# long) convert exactly — no floating-point precision loss.

client-side only BigInt precision no signup
input.txt
converted.txt

// how input is read

Pick the base your typed digits are in using the radio buttons above the input — this is deliberately explicit rather than guessed, since a string like 10 means very different things depending on whether it's binary (2), octal (8), decimal (10), or hex (16). If you paste a value with an explicit prefix — 0x/0X for hex, 0b/0B for binary, or 0o/0O for octal — that prefix always wins over whatever base is selected, so pasting 0xFF while "Decimal" is selected still reads as hex.

// why this handles 64-bit values correctly

Every conversion here uses JavaScript's BigInt rather than Number. A plain Number can only represent integers exactly up to 2^53 - 1 (Number.MAX_SAFE_INTEGER), but a C# long / ulong ranges up to 2^63 - 1 / 2^64 - 1 — well past that safe limit. Converting a large 64-bit value through Number silently rounds it to the nearest representable double, producing a wrong answer with no error. BigInt has arbitrary precision, so values like long.MaxValue (9223372036854775807) or ulong.MaxValue (18446744073709551615) round-trip exactly across all four bases.

// where each base shows up in .NET / backend work