Number Base Converter
Convert whole numbers between binary, octal, decimal, hexadecimal and base 36, with the working shown.
About the Number Base Converter
A number base sets how many digits a system uses. Decimal uses ten (0–9); binary, the language of computers, uses two (0 and 1); hexadecimal uses sixteen (0–9 then A–F), and is a compact way to write binary because each hex digit is exactly four bits.
This converter works on whole numbers of any length exactly, with no rounding.
The formula
Value = dₙ×bⁿ + … + d₁×b¹ + d₀×b⁰
- d
- each digit, from left (highest) to right
- b
- the base
To go from decimal to another base, divide by the base repeatedly and read the remainders from last to first.
0 to 16 in common bases
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
How to read your result
- Type the number as written and choose its base.
- Binary is grouped in fours so it lines up with hex digits.
Worked example
Hex 2F to decimal
- 2 × 16¹ = 32
- F (15) × 16⁰ = 15
- 32 + 15 = 47
Questions people ask
Why do programmers use hexadecimal?
One hex digit is exactly four binary digits, so long binary values become short and readable: 1111 1111 is FF.
Can I convert fractions?
This converter handles whole numbers. Fractions like 0.1 often have no exact binary form.