Hex Calculator
Calculate with hexadecimal numbers. Add, subtract, multiply, or divide two hex values, then copy the result for programming and quick checks.
Hex Calculator
Result will appear here...
What the hex calculator does
This adds, subtracts, multiplies, and divides hexadecimal numbers, giving the answer back in hex. Enter two hex numbers, choose an operation, and you get the result without having to convert to decimal and back yourself.
That convenience is the point. When the numbers you are working with are already in hex, doing the sum directly in hex keeps you in the form you actually care about.
How to use it
- Enter the first number. Type it in hex, using digits 0 to 9 and letters A to F.
- Pick an operation and enter the second number. Choose add, subtract, multiply, or divide, then type the second hex number.
- Press Calculate. The answer appears in hex.
Press Reset to clear everything.
Arithmetic that carries at sixteen
Hex arithmetic is the same column method as ordinary arithmetic, with one change: a column carries when it reaches 16 rather than 10. That is because hex is base 16, so each column is worth sixteen times the one to its right. When you add a column and the total is 16 or more, you subtract 16, write what remains, and carry 1 to the next column. Everything else, the right-to-left order, the carrying, works exactly as you already know.
A worked example with real numbers
Let us add 1A and 2F in hex. Remember A is 10 and F is 15. Work right to left.
- Rightmost column: A + F is 10 + 15 = 25. That is 16 or more, so subtract 16 to get 9, write 9, and carry 1.
- Next column: 1 + 2, plus the carried 1, is 4. Write 4.
The answer is 49 in hex. To check it, 1A is 26 and 2F is 47, and 26 + 47 is 73, while 49 in hex is 4 sixteens and 9, which is 64 + 9, also 73. The only new habit was carrying at 16 instead of 10.
The letters in the sums
Hex uses the digits 0 to 9 and then the letters A to F for the values 10 to 15. In a calculation they behave purely as those numbers, so A is just 10 and F is just 15. An answer can contain letters too: if a column comes to 13, for instance, it is written as the single hex digit D. They are digits, not text, so the arithmetic treats them like any other.
Where hex arithmetic earns its keep
Hex is the working language of several parts of programming, and that is where calculating in it directly saves trouble. Memory addresses are written in hex, so adding an offset to an address is a hex sum. Sizes and ranges of memory come in hex, and so do colour values, where you might want to adjust one channel of a colour. In all of these you start with hex and want to end with hex, so stepping out to decimal and back each time is just friction this removes.
Questions people ask
How does hex arithmetic work?
The same way as ordinary arithmetic, except a column carries when it reaches 16 instead of 10, because hex is base 16. You add right to left, carrying 1 whenever a column hits 16 or more.
What is 1A plus 2F in hex?
49. The rightmost column, A plus F, is 25, which is 16 or more, so you write 9 and carry 1; the next column gives 4. As a check, both sides equal 73 in decimal.
How do the letters work in a calculation?
They are digits standing for values: A is 10 through F is 15. The arithmetic uses those values, and answers can include letters too, so a column totalling 13 is written D.
Do I need to convert to decimal first?
No. The calculator works in hex from start to finish, so you enter hex and get hex, with no manual conversion either way.
References
- Weisstein, Eric W. "Hexadecimal." From MathWorld, A Wolfram Resource. https://mathworld.wolfram.com/Hexadecimal.html
Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.