Hex Calculator & Converter
Pick Converter to translate a value between hex, decimal and binary, or Calculator to do arithmetic on two hex numbers. Results appear in hex and decimal together, and the guide below shows how to get the same answers by hand.
Related calculators
Created by the Reeliy Editorial Team. Last updated: Oct 19, 2026
What is a hexadecimal number?
Hexadecimal, usually shortened to hex, is a base-16 positional system. Decimal has ten digits, 0 to 9. Hex has sixteen: the same ten digits plus the letters A to F, which stand for the values ten to fifteen. Every position is worth a power of 16 instead of a power of 10, so the hex number 2AF means 2 × 162 + 10 × 16 + 15.
Programmers favour hex because 16 is 24. One hex digit lines up with exactly four binary digits, and two hex digits describe one byte. A 32-bit value that needs thirty-two characters in binary takes only eight in hex. You will meet it in web colours such as #FF8800, memory addresses, MAC addresses, character codes and the byte dumps of file formats.
| Hex | Decimal | Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
How to use the hex calculator
- Under Select tool, choose Converter or Calculator.
- In Converter mode choose one of the four directions (hex and decimal in either order, or hex and binary in either order), type the number and press the button.
- In Calculator mode type two hex numbers, choose +, -, * or / between them and press the button. The answer is shown in hex and in decimal.
Type plain digits only. Do not add a 0x prefix, a minus sign or spaces inside the number. Hex letters can be upper or lower case; the tool prints its hex answers in lower case. When you convert decimal to hex, only the whole part is used, so 255.5 is treated as 255.
Converting hex to decimal by hand
Multiply each digit by the power of 16 that belongs to its position, counting from 0 at the right-hand end, then add the products.
value = d2 × 162 + d1 × 16 + d0for a three-digit number d2 d1 d0, with A = 10 … F = 15
Example: 2AF has the digits 2, A (10) and F (15). The value is 2 × 256 + 10 × 16 + 15 = 512 + 160 + 15 = 687. A quick sanity check: FF is 15 × 16 + 15 = 255, the largest value a single byte can hold.
Converting decimal to hex
Divide the number by 16 again and again, noting each remainder. The remainders, read from the last one back to the first, are the hex digits.
Example: to write 1000 in hex, 1000 ÷ 16 = 62 remainder 8; 62 ÷ 16 = 3 remainder 14 (which is E); 3 ÷ 16 = 0 remainder 3. Reading upward gives 3E8. Check: 3 × 256 + 14 × 16 + 8 = 768 + 224 + 8 = 1000.
Hex to binary and back
Because each hex digit is exactly four bits, no arithmetic is needed. Replace every hex digit with its 4-bit group from the table above, or group a binary number in fours from the right and replace each group with its hex digit.
Example: 3E8 becomes 0011 1110 1000, which is 1111101000 once the leading zeros are dropped (that is also 1000 in decimal). Going the other way, 1A3F is 0001 1010 0011 1111. If the binary length is not a multiple of four, pad the left end with zeros first.
Arithmetic with hex numbers
Column arithmetic works exactly as it does in decimal, except that a column carries or borrows at 16 instead of 10.
- Addition. 2AF + 1B3: F + 3 = 18, write 2 and carry 1; A + B + 1 = 22, write 6 and carry 1; 2 + 1 + 1 = 4. The sum is 462, which matches 687 + 435 = 1122.
- Subtraction. FF − 1A: F − A = 5 in the units column and F − 1 = E in the sixteens column, so the result is E5, the same as 255 − 26 = 229.
- Multiplication. 1F × A is 31 × 10 = 310 in decimal, so the product is 136 in hex.
- Division. A0 ÷ 3 is 160 ÷ 3 = 53.33… The calculator reports the whole part, 35 in hex, in the hex line and the full quotient in the decimal line.
When a hand calculation feels error-prone, convert both numbers to decimal, work there and convert back. You can cross-check results with the binary calculator or the dedicated hex to decimal and decimal to hex converters.
Limits and special cases
- 64-bit range. Whole numbers up to 7FFFFFFFFFFFFFFF (9,223,372,036,854,775,807) are handled as integers. Past that the tool falls back to floating point, and anything above 253 (9,007,199,254,740,992) is shown as the nearest double: hex 123456789ABCDEF1 is really 1,311,768,467,463,790,321 but is printed as 1,311,768,467,463,790,336.
- Negative results. If a subtraction goes below zero, the decimal line shows the negative number while the hex line shows the 64-bit two's-complement pattern. For 1 − FF you get −254 and ffffffffffffff02.
- Too big for hex. Results above 263 can be shown in decimal but not in hex; the hex line then says the number is too large.
- Whole numbers only. Hex input with a point, a sign or a 0x prefix is rejected as invalid characters.
- A lone 0. An input field containing just the single character 0 is treated as empty. Type 00 if you really need to enter zero.
Common mistakes
- Reading 10 as ten. In hex, 10 is sixteen; ten is written A.
- Mixing up the letter O with the digit 0, or B with 8, when copying values by eye.
- Forgetting that carries happen at 16: C + 7 is 19 in decimal, which is 13 in hex (write 3, carry 1).
- Entering decimal digits while the Binary to Hex option is selected. Binary input may contain only 0 and 1.
Frequently asked questions
How do I convert hex to decimal?
Multiply each hex digit by 16 raised to its position (starting at 0 on the right) and add the results. For example 2AF = 2 × 256 + 10 × 16 + 15 = 687.
What is FF in decimal?
FF is 15 × 16 + 15 = 255, the largest value that fits in one byte. 100 in hex is 256.
Does it matter whether I type hex letters in upper or lower case?
No. A to F and a to f mean the same thing. The calculator prints its own hex answers in lower case.
Why does a negative hex result look like ffffffffffffff02?
Computers store negative whole numbers in two's complement. In a 64-bit register, −254 is the bit pattern ffffffffffffff02. The decimal line of the result shows the ordinary negative number.
Can I enter hex numbers with a fractional part?
Not in this tool. The converter and calculator work on whole numbers, so a hex point such as 1A.8 is rejected.
Cite this calculator and page
If you use this page in your work, you can cite it as:
Reeliy Editorial Team. (2026). Hex Calculator & Converter. Reeliy. https://reeliy.com/calculators/hexadecimal-calculator“Hex Calculator & Converter.” Reeliy, 2026, https://reeliy.com/calculators/hexadecimal-calculator.