free tool, no sign-up
Hex to Decimal & Number Base Converter
Convert hex to decimal and other whole numbers between bases 2 and 16, including binary, octal, and hexadecimal, with place values and division steps.
A non-negative whole number. Letters A–F are allowed when the from-base uses them, in either case. Up to 64 bits, about 20 decimal digits.
Enter a number to convert.
Enter a whole number to see it converted, with the place values or the division remainders written out.
This number base converter is for math and computer-science students who need a whole number written in another base. Choose binary, octal, decimal, hexadecimal, or any other base from 2 through 16, and the result updates as you type. The working is filled in with your digits, either as a place-value sum or as division remainders, and the same value is listed in all four common bases. A number past 64 bits is explained in words.
Place value turns each digit into a decimal amount
Each digit has a place value that starts at 1 on the right and is multiplied by the base for every step to the left. Hexadecimal FF puts 15 in the sixteens place and 15 in the ones place, so the number is 15×16 + 15×1, which equals 240 + 15, or 255. Binary uses powers of two the same way: 1010 is 1×8 + 0×4 + 1×2 + 0×1, which equals 10.
Remainders build the digits of the new base
Going from decimal to another base uses repeated division. Divide the number by the new base, write down the remainder, and divide the quotient again until the quotient is 0. The first remainder is the least significant digit, because it is the ones place, and each later remainder sits one place further left. For 255 in hexadecimal, 255 ÷ 16 leaves remainder 15 (the digit F), then 15 ÷ 16 leaves remainder 15 (another F), and reading those remainders from the last one back to the first gives FF.
Binary, octal, decimal, and hexadecimal are four ways to write the same value, and the page lists all four under the result you asked for. Any base from 2 through 16 is available on both sides. Letters A through F stand for the values 10 through 15, and either uppercase or lowercase is read the same way. A number longer than 64 bits, about 20 decimal digits, gets a short message asking you to shorten it.
Frequently Asked Questions
How do you convert a hexadecimal number to decimal?
Write the decimal value of each digit, with A through F standing for 10 through 15. Multiply each of those values by its place, starting at 1 on the right and times 16 for each step left, then add. FF is 15×16 + 15×1, which is 255.
Which remainder is written first when converting from decimal?
The first remainder is the least significant digit, the ones place. Each new remainder is the next digit to the left, so the list is read from the last remainder back to the first. Dividing 26 by 16 gives remainder 10 (A) and then remainder 1, and reading upward writes 1A.
What is 255 in hexadecimal, and what is 64 in binary?
255 is FF in hexadecimal, because 15 sixteens and 15 ones make 255. 64 is 1000000 in binary, because 64 is 2 to the sixth power and the six lower places are zero.
Can the bases be something other than 2, 8, 10, or 16?
Yes. Both menus include every whole-number base from 2 through 16, and the binary, octal, decimal, and hexadecimal buttons are shortcuts into those menus. A base above 10 uses letters, so base 12 uses 0 through 9 and A through B.
Why did the converter ask me to shorten the number, or reject a digit?
The page converts whole numbers up to 64 bits, which is about 20 decimal digits, and a longer value is declined in words. Every digit also has to belong to the from-base, so binary accepts only 0 and 1, and hexadecimal accepts 0 through 9 and A through F in either case. A leading 0x is read for hexadecimal, 0b for binary, and 0o for octal.