2 · 8 · 10 · 16 · 36

Number base converter

Binary, octal, decimal, hex and base36 — converted exactly with BigInt, with the source base chosen explicitly and every digit validated.

Prefixes are optional; digits are validated against the source base.

Source base

Conversion runs in this tab with BigInt arithmetic. Nothing is sent anywhere.

Short answer: type the number, pick the base it is written in, and see it in binary, octal, decimal, hex and base36. Bit grouping and byte length are included because that is what you actually check against a register, a flag or a binary protocol.

Where each base shows up

Why precision is the interesting part

A 64-bit id is larger than JavaScript's safe integer range. A converter that parses toNumber and prints back loses the last digits and gives you a plausible wrong answer — the kind of bug that shows up as "user not found" in production. BigInt keeps every digit, and the byte count tells you whether the value fits in 4 bytes, 8 bytes or neither.

Number base questions

Why does this not lose precision like a normal calculator?

It uses BigInt instead of floating point. JavaScript numbers are exact only up to 2^53, so tools built on Number silently change a 64-bit id such as 18446744073709551615. Here the full value survives, and the byte length is reported.

Which prefixes are accepted?

0x for hex, 0b for binary and 0o for octal, matching the base you selected. If the prefix contradicts the selected base the conversion stops and says so, rather than guessing which one you meant.

What is base36 used for?

Short identifiers: base36 packs a large number into digits and letters, so a numeric id becomes a shorter string that survives case-insensitive systems. Databases and URL shorteners use it for exactly that reason.

How do negative numbers work?

A minus sign is carried through and printed in every base. Two's-complement representation depends on a fixed bit width, which is a decision your code makes, not this converter — so it does not invent one.

Does the page send my number anywhere?

No. Conversion is string and BigInt arithmetic in the tab.

Related tools