Number Base Converter
Type a number, choose the base it is in and the base you want, and get the exact result instantly, plus binary, octal, decimal and hex side by side. Works with integers of any size, negative numbers and fractional parts, and shows the division and multiplication steps.
Step-by-step conversion
How to use the Number Base Converter
- Type the number you want to convert. You can use a minus sign and a dot for the fractional part; spaces and underscores are ignored.
- Choose the From base the number is written in and the To base you want. Use ⇄ to swap them.
- Read the result and the quick binary, octal, decimal and hex panel. A ≈ sign means the fraction was cut off at the chosen precision.
- Open the steps to see how the conversion is done by hand, then press Copy result.
Common bases and their digits
| Base | Name | Digits | 255 written in this base | Where you see it |
|---|---|---|---|---|
| 2 | Binary | 0 1 | 11111111 | Bits, logic, networking masks |
| 8 | Octal | 0–7 | 377 | Unix file permissions (chmod 755) |
| 10 | Decimal | 0–9 | 255 | Everyday numbers |
| 12 | Duodecimal | 0–9, A, B | 193 | Dozens, clocks, imperial units |
| 16 | Hexadecimal | 0–9, A–F | FF | Colours (#FF8800), memory addresses, byte dumps |
| 32 | Base 32 | 0–9, A–V | 7V | Compact identifiers (this is the numeric "base32hex" alphabet, not RFC 4648 Base32 encoding) |
| 36 | Base 36 | 0–9, A–Z | 73 | Short IDs and URL shorteners, case-insensitive codes |
Worked example: 10.625 to binary
Integer part 10: 10 ÷ 2 = 5 r 0; 5 ÷ 2 = 2 r 1; 2 ÷ 2 = 1 r 0; 1 ÷ 2 = 0 r 1. Reading the remainders upward gives 1010.
Fractional part 0.625: 0.625 × 2 = 1.25 → 1; 0.25 × 2 = 0.5 → 0; 0.5 × 2 = 1.0 → 1. The fraction is now 0, so it stops: .101.
So 10.62510 = 1010.1012. Check: 8 + 2 + 0.5 + 0.125 = 10.625.
Shortcuts between binary, octal and hex
Because 8 = 23 and 16 = 24, you can convert without going through decimal. Group binary digits in threes for octal or fours for hex, starting from the point (pad with zeros at the ends), and replace each group with one digit:
| Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
Example: 1011 01102 = B616, and 10 110 1102 = 2668. Tick Group digits to see the groups in the results.
When does a fraction terminate?
Write the fraction in lowest terms. It has a finite expansion in base b only if every prime factor of the denominator also divides b. Base 10 has the primes 2 and 5, so 1/8 = 0.125 ends but 1/3 = 0.333… does not. Base 2 only has 2, so 0.1 (1/10) repeats as 0.0(0011) in binary, which is why 0.1 + 0.2 is not exactly 0.3 in floating-point arithmetic. Base 12 has 2 and 3, so 1/3 is simply 0.4 in duodecimal.
Frequently asked questions
How do I convert a decimal number to binary?
Divide the number by 2 again and again and write down each remainder; reading the remainders from the last to the first gives the binary digits. For example 13 ÷ 2 gives remainders 1, 0, 1, 1, so 13 is 1101 in binary. The steps panel shows this for any number and base.
How are fractional parts converted?
Multiply the fractional part by the target base repeatedly. The whole-number part of each product is the next digit after the point. For 0.625 to binary: 0.625 × 2 = 1.25 (digit 1), 0.25 × 2 = 0.5 (digit 0), 0.5 × 2 = 1 (digit 1), so 0.625 = 0.101 in binary.
Why does 0.1 in decimal become a never-ending binary number?
A fraction ends in a base only if its denominator, in lowest terms, has no prime factors other than those of the base. 0.1 is 1/10 and 10 contains the factor 5, which 2 does not, so in binary it repeats forever: 0.0001100110011… The converter shows ≈ and the repeating block.
What digits are used for bases above 10?
Letters continue after 9: A = 10, B = 11 and so on up to Z = 35, which is why 36 is the largest base that can be written with 0–9 and A–Z. Letters are not case-sensitive in the input.
Is there a size limit?
Integer parts can be as long as you like because the converter uses exact big-integer arithmetic, so a 200-digit decimal number converts exactly. Fractional output is limited by the precision setting (up to 500 digits).
How are negative numbers handled?
The minus sign is kept and the magnitude is converted, so -255 in decimal is -FF in hex. This is the mathematical (sign-magnitude) form, not the two's complement bit pattern a computer uses for signed integers.