Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal, and any base 2–36 with BigInt precision — no rounding, ever.
Convert integers between binary, octal, decimal, hexadecimal, and any base 2–36 — powered by BigInt, so a 30-digit decimal converts to binary with every bit exact and no floating-point drift anywhere in the chain.
How to use Number Base Converter
- Type the number and pick the base it is written in.
- Read all five representations at once.
- Set a custom base (2–36) for anything exotic.
Who it is for
Developers reading wire dumps and bit flags, students checking homework against exact answers, embedded engineers converting register values, and anyone who caught a calculator rounding a large integer.
How it works
- Input accepts digits and letters a–z case-insensitively in any base from 2 to 36, with an invalid-digit error naming the offending character.
- All five outputs (binary, octal, decimal, hex, custom base) come from one BigInt parse — no double conversions, no precision loss.
- Negative numbers keep their sign across every base.
What it cannot do
- Integers only — fractional values are out of scope for base conversion done honestly.
- Very long inputs (thousands of digits) are allowed but render proportionally long outputs.
Sample input & output
Decimal input: 9007199254740993 (2^53 + 1, one above JavaScript Number.MAX_SAFE_INTEGER) with custom base set to 36
Binary: 100000000000000000000000000000000000000000000000000001 | Octal: 400000000000000001 | Hex: 20000000000001 | Base-36: 2gosa7pa2gv — zero rounding loss.
Frequently asked questions
Why BigInt instead of Number?
JavaScript numbers silently lose integer precision above 2^53. BigInt converts exactly — the whole point of the tool.
Can I paste "0x" or "0b" prefixes?
Strip the prefix first: choose base 16 or 2 and paste the digits alone.
What is the largest number it can take?
As many digits as you can paste — BigInt is only limited by memory, not by 64 bits.
What happens to integers above 9,007,199,254,740,991 in tools that use standard 64-bit floats?
Standard IEEE-754 double-precision floating-point numbers allocate 1 sign bit, 11 exponent bits, and 52 explicit significand (mantissa) bits, giving 53 bits of integer precision (2^53 - 1 = 9,007,199,254,740,991). Above that threshold, adjacent odd integers collapse onto even numbers, corrupting 64-bit Snowflake IDs, database primary keys, memory addresses, and SHA digests. Parsing directly into arbitrary-precision BigInt eliminates that 53-bit ceiling completely.
How does Base-36 encoding map digits and why is it popular for compact URLs and order IDs?
Positional radixes from 2 through 36 use the Arabic digits 0–9 for values zero through nine and the Latin letters a–z (case-insensitively) for digit values ten through thirty-five. Because Base-36 packs log2(36) ≈ 5.17 bits into every alphanumeric character without punctuation or case sensitivity, a 64-bit unsigned integer fits in at most 13 URL-safe, human-dictatable characters instead of 20 decimal digits.
Why does negative hexadecimal output show a minus sign (-ff) instead of two's complement (0xffffff01)?
Mathematical radix notation is sign-magnitude: decimal -255 equals -11111111 in base 2 and -ff in base 16 regardless of word width. Two's complement representation exists only relative to a fixed hardware register width — -255 is 0xff01 in 16-bit signed arithmetic, 0xffffff01 in 32-bit, and 0xffffffffffffff01 in 64-bit. To compute an N-bit two's complement value from -X, add 2^N to -X in decimal first.
Why can fractional decimals like 0.1 not be converted cleanly into finite binary digits?
A fraction p/q in lowest terms terminates in base b if and only if every prime factor of q divides b. Because base 10 has prime factors 2 and 5 while base 2 has only factor 2, one-tenth (1/10) expands in binary as the infinite repeating fraction 0.0001100110011... Restricting conversion to exact integers avoids arbitrary truncation choices that differ between IEEE-754 half, single, and double precision.