Number Base Converter
Computers store numbers in binary, programmers often write them in hexadecimal, and people count in decimal. This converter reads a number in any base from 2 to 36 and shows it in decimal, binary, octal, hexadecimal and base 36 at the same time. It works with arbitrarily large integers.
How to use the number base converter
- Type the value. For bases above 10, letters stand for digits: A = 10, B = 11, up to Z = 35.
- Enter the base you typed it in (16 for hex, 2 for binary).
- Read the same number in the other bases. A prefix like 0x or 0b is accepted.
Formula
A number in base b with digits dk…d1d0 equals dk·bk + … + d1·b + d0. To convert out of decimal, repeatedly divide by the target base and read the remainders from last to first.
Worked examples
Hex to decimal
FF in base 16 is 15 × 16 + 15 = 255. In binary that is 11111111 and in octal 377.
Binary to decimal
1010 in base 2 is 1×8 + 0×4 + 1×2 + 0×1 = 10, which is A in hexadecimal.
How number bases work
We count in base 10 because we have ten fingers, but the idea works for any base. In base 10 the digits 0–9 stand for ones, tens, hundreds, and so on, each place worth ten times the one to its right. In base 2, each place is worth twice the one to its right.
Comparison table
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 5 | 101 | 5 | 5 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
Why computers use binary
A transistor is either on or off, so two states map naturally to 1 and 0. Eight bits form a byte, which can hold 2⁸ = 256 different values (0 to 255). That is why FF, the largest two-digit hex value, equals 255.
Converting by hand
To convert 45 to binary, divide by 2 repeatedly: 45 → 22 r1, 22 → 11 r0, 11 → 5 r1, 5 → 2 r1, 2 → 1 r0, 1 → 0 r1. Reading the remainders from the bottom up gives 101101. To go the other way, add the place values: 32 + 8 + 4 + 1 = 45.
Everyday examples
Web colours like #FF8800 are three hex bytes (red, green, blue). File permissions on Linux are written in octal (755). IP addresses are four bytes written in decimal.
Practice problems
Try these yourself first, then check your answer. The answers come from the calculator above.
- Convert 2026 (decimal) to binary and hex.
Show answer
Decimal (base 10): 2026
- What is the binary number 110101 in decimal?
Show answer
Decimal (base 10): 53
- What is hex 3E8 in decimal?
Show answer
Decimal (base 10): 1000
Common mistakes to avoid
- Using a digit that does not exist in the base, such as 2 in binary or 9 in octal. The converter tells you which digit is invalid.
- Reading hex letters as text. A, B, C, D, E, F are the values 10 to 15.
Frequently asked questions
How do I convert decimal to binary?
Enter the decimal number with base 10. The binary row shows the result, which comes from repeated division by 2.
Why do programmers use hexadecimal?
One hex digit represents exactly four bits, so it is a compact way to write binary values such as colours (#FF8800) and memory addresses.
What is the largest base supported?
Base 36, which uses digits 0–9 and letters A–Z.
Can it convert negative or fractional numbers?
This tool handles non-negative whole numbers. For fractions or negatives, convert the whole part and fractional part separately.
Reviewed September 26, 2026 by the SolveCalcPro editorial team. Found a mistake? Tell us; see our editorial policy.