Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, negatives and fractions included, with the division and place-value working shown. Binary add, subtract and multiply too.
Result…
How it's calculated
Place value: dₙ…d₁d₀ in base b = dₙ × bⁿ + … + d₁ × b + d₀ To base B: divide the whole part by B repeatedly; the remainders, last first, are the digits Fractions: multiply by B repeatedly; the whole-number parts, in order, are the digits
Converts whole numbers of up to 300 digits exactly (they are held as big integers, not floating-point numbers), plus negative numbers and fractional parts. Digits above 9 are the letters A to Z, so base 36 uses 0–9 and A–Z. A fraction that ends in one base may not end in another (0.1 in decimal is 0.000110011… in binary); those are cut off after the number of digits you choose and marked with …, never rounded. Negative numbers are shown with a minus sign, and for whole negatives the two's complement bit pattern computers use is shown at the smallest width of 8, 16, 32, 64 or 128 bits that holds it. Binary arithmetic adds, subtracts and multiplies whole binary numbers with the column working.
Your numbers, step by step
About the Number Base Converter calculator
This number base converter turns a number from one base into another: binary, octal, decimal, hexadecimal or any base from 2 to 36. It shows the number in all four common bases at once and writes out the working, the place values that turn digits into a decimal value and the repeated division that turns it into the new base. Whole numbers up to 300 digits long are converted exactly, because they are held as big integers rather than rounded floating-point numbers. Negative numbers and fractional parts work too, and for a negative whole number it shows the two's complement bit pattern that computers store. Programmers use it to read hex colour codes, memory addresses and bit masks; students use it to check conversions done by hand. A binary arithmetic mode adds, subtracts and multiplies binary numbers with the column working. Each digit is a remainder, which the modulo calculator also finds.
How to use it
- Leave “Do” on “Convert”, type the digits in “Number”, and choose the bases in “From” and “To”. Pick “Another base (2–36)” to enter any other base.
- Use letters for digits above 9: A is 10, F is 15 and Z is 35. A minus sign and a point are allowed, and 0b, 0o and 0x prefixes are ignored.
- Set “Digits after the point (at most)” to limit how far a fraction that never ends is written out.
- For binary sums, switch “Do” to “Binary arithmetic”, enter the two binary numbers and pick +, − or ×.
Worked example
To write 2026 in hexadecimal, divide by 16 again and again: 2026 ÷ 16 = 126 remainder 10 (A), 126 ÷ 16 = 7 remainder 14 (E), 7 ÷ 16 = 0 remainder 7. Reading the remainders from the last to the first gives 7EA. The same number is 11111101010 in binary and 3752 in octal. A fraction works by multiplying instead: decimal 0.625 is 0.101 in binary.
Updated
Questions people ask
How do I convert decimal to binary by hand?
Divide the number by 2, write down the remainder, and repeat with the quotient until it reaches 0. The remainders read from the last to the first are the binary digits. The steps show each division with your number.
How do I convert binary or hex to decimal?
Multiply each digit by its place value, a power of the base, and add them up. For hex 1A, that is 1 × 16 + 10 × 1 = 26.
Why does 0.1 never end in binary?
A fraction ends in a base only if its denominator is built from that base's prime factors. One tenth needs a factor of 5, which binary does not have, so 0.1 becomes 0.000110011… for ever. The converter cuts it off at the number of digits you set and marks it with …, without rounding.
What is two's complement?
It is how computers store negative whole numbers: the bit pattern of 2ⁿ minus the number's size, for an n-bit width. In 8 bits, −5 is 11111011. The converter shows it at the smallest of 8, 16, 32, 64 or 128 bits that fits.
What digits does base 36 use?
The ten digits 0–9 and then the 26 letters A–Z, so Z stands for 35. Letters can be typed in upper or lower case.
Is there a limit on how big a number can be?
Inputs can be up to 300 digits long, and whole numbers of that size are converted exactly. Fraction digits are limited to 60 after the point.