Base Converter
Convert whole and fractional numbers from any base to any base (2-36), with step-by-step division and multiplication working
By Waqar Mushtaq · Last updated:
This base converter translates a number from any base between 2 and 36 into any other, including the part after the radix point -- so 10.625 in decimal becomes 1010.101 in binary, and FF.8 in hexadecimal becomes 255.5 in decimal. It does the arithmetic exactly (no floating-point rounding), tells you when a fraction doesn't terminate in the target base and shows its exact repeating block (decimal 0.1 is 0.0 followed by 0011 repeating forever in binary), and lays out the full working: the positional expansion into decimal, the repeated division for the whole-number part, and the repeated multiplication for the fractional part. If you only need whole numbers shown in binary, octal, decimal, and hex at once, the Base Calculator is the quicker tool.
How Base Conversion Works (Including Fractions)
O(n) in the number of digitsd_i = digit at position i · b = source base · positions to the right of the radix point are negative
Fractional part f, target base B: each product's integer part is the next digit after the radix point
Converting between two arbitrary bases goes through the number's value in three moves.
1. Expand the source number into its value. Every digit is worth its face value times the source base raised to its position -- positive positions to the left of the radix point, negative positions to the right. FF.8 (base 16) = 15 × 16¹ + 15 × 16⁰ + 8 × 16⁻¹ = 240 + 15 + 0.5 = 255.5
2. Convert the whole-number part by repeated division. Divide by the target base, write down the remainder, and keep dividing the quotient until it reaches 0. The remainders read bottom to top are the digits. 10 ÷ 2 = 5 r 0 → 5 ÷ 2 = 2 r 1 → 2 ÷ 2 = 1 r 0 → 1 ÷ 2 = 0 r 1 → 1010
3. Convert the fractional part by repeated multiplication. Multiply the fraction by the target base; the integer part of the product is the next digit, and the leftover fraction carries on. The digits read top to bottom. 0.625 × 2 = 1.25 → 0.25 × 2 = 0.5 → 0.5 × 2 = 1.0 → .101 So 10.625 (decimal) = 1010.101 (binary).
Why some fractions never end. A fraction terminates in base B only if its denominator (in lowest terms) has no prime factors other than those of B. 1/10 has a factor of 5, which 2 doesn't have, so decimal 0.1 repeats forever in binary: 0.1 × 2 = 0.2, 0.4, 0.8, 1.6, 1.2, 0.4, ... and the remainder 0.4 coming back means the digits 0011 repeat from there on. This converter tracks those remainders exactly, which is how it finds the repeating block rather than just cutting the digits off.
Use Cases
Floating-Point and Fixed-Point Understanding
See exactly why 0.1 + 0.2 isn't 0.3 in most programming languages: 0.1 and 0.2 have infinitely repeating binary expansions, so any finite binary format has to round them. Converting a value to binary with a set number of fractional digits also shows what a fixed-point (Q-format) representation stores.
Checking Homework Step by Step
Number-system conversion is a standard topic in digital logic and computer architecture courses. The division and multiplication tables show each intermediate value, so you can find exactly which step of a hand calculation went wrong.
Converting Between Non-Decimal Bases
Go straight from octal to hexadecimal, base 3 to base 7, or any other pair without converting to decimal by hand in between -- the decimal value is still shown for reference.
Compact Identifiers in Base 36
Base 36 (digits 0-9 plus a-z) is used for short, URL-friendly IDs. Convert a numeric ID to base 36 and back to confirm an encoding round-trips correctly.
Frequently Asked Questions
How do you convert a decimal fraction to binary?
Multiply the fractional part by 2. The integer part of the result (0 or 1) is the first binary digit after the point; keep the remaining fraction and repeat. Stop when the fraction becomes 0, or when you have as many digits as you need. For 0.625: 0.625 × 2 = 1.25 (digit 1), 0.25 × 2 = 0.5 (digit 0), 0.5 × 2 = 1.0 (digit 1), so 0.625 = 0.101 in binary.
Why does 0.1 in decimal become a repeating number in binary?
A fraction only has a finite expansion in a base if its denominator divides some power of that base. 0.1 is 1/10, and 10 = 2 × 5; no power of 2 is divisible by 5, so the binary digits never end. They do repeat, though: 0.1 (decimal) = 0.0 followed by 0011 repeating forever.
What does the overlined block in the result mean?
It's the repetend -- the block of digits that repeats forever. 0.13 with a line over the 3 means 0.1333..., and in this converter the same notation is used in whatever target base you choose. The period is the length of that block.
Can a fraction terminate in one base but repeat in another?
Yes. 1/3 is 0.333... in decimal but exactly 0.1 in base 3. Whether a fraction terminates depends entirely on how the denominator's prime factors compare with the target base's prime factors, not on the value itself.
How is this different from the Base Calculator?
The Base Calculator converts whole numbers and shows binary, octal, decimal, hex, and one custom base at once, plus a bit-by-bit breakdown. This converter handles fractional values, converts directly between any two bases, detects repeating digits, and shows the step-by-step division and multiplication working.
Methodology
The formula above is implemented as a standalone module covered by unit tests, so its worked examples are re-checked on every change to the site. It is verified against the authoritative sources listed below.
Maintained by Waqar Mushtaq. Spotted a result that looks wrong? Report it and it becomes a failing test.