Hex Calculator (Add, Subtract, Multiply, Divide)
Add, subtract, multiply and divide hexadecimal numbers with decimal and binary equivalents. Hexadecimal is base 16, so each column is worth sixteen times the one to its right and a carry happens whenever a column reaches 16. Example: with first hex number FF, …, the result is Result (hex) = 119.
Last updated · By S. Dilshan · Runs in your browser, nothing is uploaded
Step-by-Step Solution
How do you use the Hex Calculator (Add, Subtract, Multiply, Divide)?
Enter two hexadecimal numbers using the digits 0 to 9 and the letters A to F, upper or lower case, with or without a 0x prefix. Choose an operation and read the result in hexadecimal, decimal and binary. When you divide, the remainder is shown beside the quotient. Negative results are shown with a minus sign, and very large values are handled exactly.
The Step-by-Step Solution converts both numbers to decimal, performs the operation and converts the answer back, and includes a reminder of how hex digits work for calculations done by hand.
What formula does the Hex Calculator (Add, Subtract, Multiply, Divide) use?
Hexadecimal is base 16, so each column is worth sixteen times the one to its right and a carry happens whenever a column reaches 16. The letters stand for A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. To add by hand, add each column in decimal, and if the total is 16 or more, write the remainder after subtracting 16 and carry 1 to the next column.
For example, in the right column F + 1 = 16, which is 0 with a carry of 1. Multiplication and division follow the same rules as decimal, but with a larger set of digits. Many people find it easiest to convert to decimal, calculate and convert back, which is the method this tool shows.
Worked examples
FF + 1 = 100 in hex, because 255 + 1 = 256 and 256 is 16². A × B in hex is 10 × 11 = 110, which is 6E, since 6 × 16 + 14 = 110. And 10 ÷ 3 in hex is 16 ÷ 3 = 5 with remainder 1. Subtracting 1A from FF gives E5, since 255 − 26 = 229. Each result can be checked by converting back to decimal, and the binary output lets you see the bit patterns directly.
Where hex arithmetic is used
Programmers use hexadecimal arithmetic for memory addresses, offsets, bit masks, checksums and colour values. Adding 0x20 to an address, finding the size of a region from its start and end addresses, or adjusting a colour channel are all everyday jobs. Hardware and embedded engineers read hex dumps and register values constantly.
Hex is popular because it is compact and maps neatly to binary: each digit stands for exactly four bits, so a byte is two hex digits. Learning to do small hex sums by hand, such as adding a few bytes or computing an offset, saves a lot of time when debugging and reading technical documents.
What are the most common mistakes with the Hex Calculator (Add, Subtract, Multiply, Divide)?
- Carrying at 10 instead of at 16.
- Forgetting the values of the letters, for example treating B as 12 instead of 11.
- Mixing hex and decimal digits in the same calculation, such as reading 10 as ten when it means sixteen.
- Ignoring a minus sign or the remainder when dividing.
What Is the Tested Example for the Default Values?
This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.
| Input: First hex number | FF |
|---|---|
| Input: Second hex number | 1A |
| Input: Operation | Add |
| Result (hex) | 119 |
| Result (decimal) | 281 |
| Result (binary) | 100011001 |
Where Can You Verify These Formulas?
The definitions and formulas on this page follow standard references. Check them against these sources:
Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.
Frequently Asked Questions
How do you add hexadecimal numbers?
Add each column in decimal; if the sum is 16 or more, subtract 16 and carry 1 to the next column. For example, F + 1 = 10 in hex.
What is FF in decimal?
255. Each F is 15, so FF = 15 × 16 + 15 = 255.
Can this calculator handle negative results?
Yes. If the first number is smaller than the second in a subtraction, the result is shown with a minus sign.