Developer · Number bases

Number base converter.

Convert a number between any two bases from 2 to 36: binary, octal, decimal, hexadecimal or something unusual like base 36. Whole numbers of up to 300 digits are exact, fractions are converted to 20 places, and the working is shown step by step. Runs in your browser; nothing is sent.

Hex FF is 15 × 16 + 15 = 255 in decimal. Going the other way, 255 ÷ 16 = 15 remainder 15, and 15 ÷ 16 = 0 remainder 15; reading the remainders from last to first gives FF (the digit F is 15). Binary 1010 is 10 in decimal.

Digits 0-9 then A-Z (A = 10, F = 15, Z = 35)Whole numbers: exact up to 300 digitsOpened sources 8 October 2026

Advertisement

Your number

Digits valid in the starting base, with an optional minus sign, point and 0x, 0b or 0o prefix. Spaces and underscores are ignored.

Your result

Fill the form and press Calculate.

How base conversion works

In positional notation each digit is worth the digit times a power of the base. Reading FF in base 16: the left F is 15 × 161 = 240 and the right F is 15 × 160 = 15, so FF is 255. To go from a decimal value to another base, divide by the new base repeatedly: the remainder of each division is the next digit, starting from the right, and the last quotient is the leftmost digit. 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F), so 255 is FF. Both tables appear under the result; the first is skipped when you start in decimal and the second when you finish in decimal. A digit above 9 is written as a letter: A to F for 10 to 15 in hexadecimal, and A to Z for 10 to 35 in base 36.

Fractions

This tool converts the part after the point by repeated multiplication: multiply the fraction by the new base, take the whole part as the next digit, keep the rest, and repeat. A fraction that terminates in one base can repeat forever in another, because 0.1 in decimal is 0.0001100110011… in binary. This tool stops at 20 digits after the point and tells you when the result is not exact. The integer part is always exact.

Worked examples

FF in base 16 is 255; 255 in base 10 is FF in base 16. Binary 1010 is 10. Decimal 0.5 is 0.1 in binary and A.8 in hexadecimal is 10.5 in decimal. Base 36 ZZ is 35 × 36 + 35 = 1295. Decimal 0.1 in binary is 0.00011001100110011001 to 20 places, not exact.

Sources, opened 8 October 2026: MDN Web Docs, Number.prototype.toString() (JavaScript represents numbers in bases from 2 through 36); Wikipedia, Positional notation (a digit times a power of the base, and base conversion by repeated division where each remainder is the next digit from the right, and non-terminating digits when the reduced denominator of a fraction has a prime factor the target base lacks, as with 0.1 in decimal to binary); Wikipedia, Hexadecimal (hexadecimal is base 16 with the digits 0 to 9 and the letters A to F for the values 10 to 15).

Note: Educational tool. Negative numbers are shown with a minus sign, not as two's complement; for fixed-width signed values use the two’s complement calculator.

Frequently asked questions

How do you convert hex to decimal?

Multiply each hex digit by 16 raised to its position, counting from 0 on the right, and add. FF is 15 x 16 + 15 = 255. The letters A to F stand for 10 to 15.

How do you convert decimal to hexadecimal?

Divide by 16 repeatedly and write down each remainder, using A to F for 10 to 15. Read the remainders from the last to the first. 255 divided by 16 is 15 remainder 15, and 15 divided by 16 is 0 remainder 15, so 255 is FF.

How do you convert binary to decimal?

Add up the powers of 2 for each 1 bit, counting from 2^0 on the right. Binary 1010 is 8 + 2 = 10.

What bases does this converter support?

Every whole-number base from 2 to 36. Digits above 9 are the letters A to Z, so base 36 uses all ten digits and all 26 letters.

Why does 0.1 in decimal not convert exactly to binary?

A fraction terminates in a base only if its denominator has no prime factors other than those of the base. 1/10 has a factor of 5, which binary lacks, so it repeats forever. The converter shows 20 binary places and flags the result as not exact.

Is there a limit on the size of the number?

Whole numbers can have up to 300 digits and are converted exactly. Fractions are limited to 20 digits after the point in the answer.

Advertisement
Advertisement