Number Base Converter
Convert whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36.
A number in base b is a sum of digit × bᵏ.
How the number base converter works
A number in base b is a sum of digit × bᵏ. To convert, first read the input in its base to get the value, then repeatedly divide by the target base and collect remainders. Hexadecimal digits run 0–9 then A–F; base 36 uses all letters.
Formula: value = Σ digitₖ × bᵏ
Worked examples
| Inputs | Converted | Note |
|---|---|---|
| 255 to binary | 11111111 | 11111111 |
| FF from hex to decimal | 255 | 255 |
| 1010 binary to hex | A | A |
FAQFrequently asked questions
Why do computers use binary?
Two states — on and off — are easy to build and reliable; every other base is a notation on top of that.
Why is hexadecimal popular?
One hex digit is exactly four bits, so a byte is two hex digits: 255 = FF.
What is 0x and 0b?
Prefixes for hex and binary in most programming languages; the converter accepts them.
How do I convert binary to decimal by hand?
Add the powers of two where there is a 1: 1011 = 8 + 2 + 1 = 11.
What is the largest number it handles?
2⁵³ − 1 ≈ 9 × 10¹⁵, the exact-integer limit of JavaScript numbers.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Common Core State Standards — Mathematics — the terms and methods taught in US schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.