free tool
Hex to decimal calculator: hexadecimal, binary and octal, with steps
Type a number in hexadecimal, decimal, binary or octal and see it in all four bases at once. The steps show the place values for converting to decimal, and the divide-and-remainder method for converting back.
Binary (base 2)
10 1111
Octal (base 8)
57
Decimal (base 10)
47
Hexadecimal (base 16)
2F
Steps: hexadecimal to decimal
- Number the places from the right, starting at 0. Each place is worth 16 times the one to its right (powers of 16).
- 2 × 16¹ = 2 × 16 = 32
- F (= 15) × 16⁰ = 15 × 1 = 15
- Add them up: 47.
Steps: hexadecimal to binary
- The quick way: each hex digit is exactly 4 binary digits.
- 2 = 0010
- F = 1111
- Put them together: 10 1111.
What hexadecimal is
Our everyday numbers are base 10: each place is worth ten times the place to its right, and we use the digits 0 to 9. Hexadecimal, or hex, is base 16. It needs sixteen digits, so after 9 it uses letters: A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
Computers use hex as a short way to write binary. Each hex digit stands for exactly four binary digits (bits), so the byte 1111 0101 is simply F5. That's why web colors look like #FF8800, and why memory addresses are written in hex.
How to convert hex to decimal
- Number the places from the right, starting at 0.
- Multiply each digit by 16 to the power of its place: 1, 16, 256, 4,096 and so on.
- Turn letters into their values first: A is 10, F is 15.
- Add up the results.
- Example: 2F = 2 × 16 + 15 × 1 = 32 + 15 = 47.
How to convert decimal to hex
- Divide the number by 16 and write down the remainder.
- Divide the answer by 16 again, and keep going until the answer is 0.
- Turn any remainder from 10 to 15 into its letter.
- Read the remainders from the bottom up.
- Example: 300 ÷ 16 = 18 r 12 (C), 18 ÷ 16 = 1 r 2, 1 ÷ 16 = 0 r 1. Reading up: 12C.
Binary and octal
Binary is base 2, with only the digits 0 and 1, and its place values are 1, 2, 4, 8, 16 and so on. Octal is base 8. The same two methods work for any base: multiply by powers of the base to get to decimal, and divide by the base to get back.
Questions people ask
- What is 0xFF in decimal?
- 255. F is 15, so FF = 15 × 16 + 15 = 240 + 15 = 255. The 0x at the start just means the number is in hex.
- How do you convert hex to binary?
- Write each hex digit as four binary digits: 0 = 0000, 9 = 1001, A = 1010, F = 1111. So 3C = 0011 1100.
- Why do computers use hexadecimal?
- Because one hex digit matches four bits exactly, hex is a short, readable way to write binary. Two hex digits make one byte.
- What is 100 in hex?
- 64. 100 ÷ 16 = 6 remainder 4, and 6 ÷ 16 = 0 remainder 6, so reading up it's 64. Check: 6 × 16 + 4 = 100.
- Is the calculator limited in size?
- It handles whole numbers up to 40 digits long in any of the four bases, exactly, with no rounding.
Practice the idea
Keep exploring
- Math by topicFractions, times tables, long division and more
- Math by gradeEvery skill from kindergarten to 8th grade
- English and grammarNouns, verbs, commas, spelling and more
- Reading passagesShort stories with read-aloud and questions
- Science by gradePlants, forces, matter, space and more
- Printable worksheetsPrint, or do them on a tablet with a finger or pen
- Free math games3D games where every move is a math question
- Manipulatives and simulationsMath tools plus science sims: cells, atoms, forces, planets
- Math flash cardsAdd, subtract, multiply and divide, online
- Calculators with stepsPercent change, long division, rounding, hex
- Lesson plan builderAny skill, K–12, with a student sheet
- Test generatorPrintable tests with answer keys
- Math 5-a-dayFive fresh warm-up questions every day
- Guides for parentsHow to help with fractions, tables, tests and more
Math, English and science that click.
