Number Base Converter, Binary, Octal, Decimal & Hex
Convert any whole number between bases 2 and 36, binary, octal, decimal, hex and everything in between, and see binary, octal, decimal and hex side by side with full step-by-step working. Exact BigInt math, no signup, runs in your browser.
How it works
A number base (or radix) is just the count of distinct digits a numeral system uses. Decimal is base 10 (digits 0–9); binary is base 2 (0–1); hexadecimal is base 16 (0–9 then A–F). The quantity never changes, only how it is written. This converter moves a value between any two bases from 2 to 36 using two standard, verifiable steps.
Step 1, source to decimal (positional expansion). Every numeral is a sum of its digits times powers of the base. For an n-digit number with digits d₍n−1₎ … d₁ d₀ in base b:
N = Σ value(dᵢ) · bi, for i = 0 … n−1
where value maps 0–9 to 0–9 and A–Z to 10–35. That digit alphabet is not arbitrary: it is the mapping fixed by the ECMAScript specification (ECMA-262) for parseInt and Number.prototype.toString(radix), which is also why the radix tops out at 36, base 36 already exhausts all ten digits and all 26 letters.
Step 2, decimal to target (repeated division). To write that quantity in the target base, divide repeatedly by the base and collect remainders:
while N > 0: r = N mod base; prepend digit(r); N = ⌊N ÷ base⌋
The remainders, read from last to first, are the target representation. A value of 0 renders simply as 0.
To stay exact for arbitrarily long inputs, every calculation uses JavaScript BigInt rather than floating-point numbers, which would lose precision above 2⁵³ (about 9 quadrillion). As a credibility check, the tool computes the decimal value twice by independent code paths, Horner's method and the explicit positional sum above, and only marks a result verified when they agree. The four-panel binary / octal / decimal / hex readout and both working displays are all derived from that single shared integer, so the steps shown can never disagree with the answer.
Worked examples
Frequently asked questions
Sources & references
- ECMA-262: Number.prototype.toString(radix): canonical 2–36 digit alphabet
- MDN: Number.prototype.toString() radix range & digit set
- MDN: parseInt(): radix parsing reference
The digit alphabet and radix range were last cross-checked against the ECMA-262 specification on 2026-06-09. The conversion math (positional expansion and repeated division) is standard place-value arithmetic and does not change.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us, our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] , most fixes ship within 24 hours.