🔢 Number Base Converter
Convert any whole number between binary, octal, decimal, hexadecimal and custom bases up to 36 – even very large numbers.
Quick answer: Each digit is multiplied by the base raised to its position and the results are added. For example, decimal 255 is 11111111 in binary, 377 in octal and FF in hexadecimal.
Updated · Free · No sign-up · Works on any device
Number Base Converter inputs
Result
Hexadecimal
FF
| Binary (base 2) | 1111 1111 |
| Octal (base 8) | 377 |
| Decimal (base 10) | 255 |
| Hexadecimal (base 16) | FF |
| Base 36 (base 36) | 73 |
8 significant bits
How positional number systems work
In any base b, each digit is worth its face value multiplied by b raised to the power of its position, counting from zero on the right. Decimal uses ten digits, binary two, octal eight and hexadecimal sixteen (0–9 then A–F).
Value = dₙ × bⁿ + … + d₁ × b¹ + d₀ × b⁰
Worked example
Hexadecimal FF = 15 × 16¹ + 15 × 16⁰ = 240 + 15 = 255. In binary the same number is 11111111 – eight ones, because 2⁸ − 1 = 255 – and in octal it is 377 (3 × 64 + 7 × 8 + 7).
Converting from decimal to another base
- Divide the number by the target base.
- Write down the remainder – it is the next digit, starting from the right.
- Repeat with the quotient until it reaches zero.
Quick reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
Tips
- Each hex digit maps to exactly four binary digits, and each octal digit to three – handy for converting by hand.
- Programmers write hex with a
0xprefix and binary with0b; the converter accepts both. - Numbers of any length are supported because the maths uses arbitrary-precision integers, so 64-bit and larger values convert exactly.
Where you will meet other bases
Binary underpins every computer, octal still appears in Unix file permissions such as chmod 755, and hexadecimal is used for colour codes like #FF8800, memory addresses and MAC addresses. Base 36 is popular for short IDs because it packs many values into few characters.
Frequently asked questions
How do I convert binary to decimal?
Write the powers of two under each bit from the right (1, 2, 4, 8 …) and add the ones under a 1. For 1011 that is 8 + 0 + 2 + 1 = 11.
How do I convert decimal to hexadecimal?
Divide by 16 repeatedly and write down the remainders, using A–F for 10–15, then read them from bottom to top. 255 ÷ 16 = 15 remainder 15, so 255 is FF.
Can I enter a 0x or 0b prefix?
Yes. A 0x prefix is ignored for hexadecimal input, 0b for binary and 0o for octal. Spaces and underscores used as digit separators are also ignored.
Why is there a limit of base 36?
Base 36 uses all ten digits plus the 26 letters of the alphabet. Higher bases would need extra symbols that have no standard convention.