What is a hexadecimal calculator?
A hexadecimal calculator does arithmetic in base 16, the number system programmers use to write binary compactly. The digits are 0 to 9 plus A for 10, B for 11, C for 12, D for 13, E for 14, and F for 15, and this calculator adds, subtracts, and multiplies hex numbers, showing the answer in hex and in decimal. This page gives you that answer in a second, with the working shown beside the result, and everything runs entirely in your browser with no sign-up and no data sent anywhere. The same hex digits appear in colour codes, and the hex to RGB converter turns a colour's hex code into its red, green and blue values.
Programmers use hex every day for colours, memory addresses, and error codes, and computer science students meet it in their first courses on number systems. Network engineers and electronics technicians read hex too, whenever a value is written more compactly than binary allows. Students meet it in school maths, programmers meet it in code, and shopkeepers and clerks meet it whenever a total has to be split fairly or checked by hand.
The results box shows the answer first, in large type, and then the supporting numbers underneath it, so you can see both the headline and the working at a glance. Change any input and the answer updates at once, which makes it easy to test a few values and build a feel for how the numbers behave.
How hexadecimal arithmetic works
Hex works like decimal addition, but in base 16, so a column total of 16 or more carries 1 to the next column. For the default example, A3 plus 1F, the right column is 3 plus F, which is 3 plus 15, or 18, which is 12 in hex, so you write 2 and carry 1. The left column is then A plus 1 plus the carried 1, which is 10 plus 1 plus 1, or 12, which is C, giving C2.
Hexadecimal uses base 16, so the place values are 1, 16, 256, and so on, multiplying by 16 at each step to the left. For A3, the A is in the sixteens place, so it is worth 10 times 16, or 160, and the 3 is worth 3, giving 163. For 1F, the 1 is worth 16 and the F is worth 15, giving 31, and 163 plus 31 is 194, which is C2 in hex.
Hex digits run from 0 to 9 and A to F, so any other letter makes the input invalid, and this calculator shows a dash instead of guessing. Lowercase letters are accepted and treated the same as uppercase, so a3 and A3 mean the same number. Subtracting a larger hex number from a smaller one gives a negative decimal result, with the hex answer shown as a dash.
A quick check is to convert both numbers to decimal using the place values 1, 16, and 256, do the arithmetic in decimal, and convert the answer back. If the decimal arithmetic and the hex arithmetic disagree, a column has carried wrongly, which is the most common slip in hex addition.
The letters A to F are the part people get wrong
The letters are the input people get wrong, because A is 10, not 1, and F is 15, not 6. In A3, the A is worth 160, not 16, because it sits in the sixteens place, and forgetting either the letter value or the place value gives a wrong answer. Writing the letter values out, A is 10 through F is 15, before starting the arithmetic, prevents most errors.
Compare A times 2 with A3 minus 1F to see the letters at work. A is 10, and 10 times 2 is 20, which is 14 in hex, because 16 plus 4 is 20. A3 is 163 and 1F is 31, and 163 minus 31 is 132, which is 84 in hex, because 8 times 16 plus 4 is 132.
The safe habit is to read the input back before trusting the output: check the digits, check the sign, and check that you have not swapped the two numbers round. A calculator only repeats the question you actually asked it, so a careful ten seconds on the input saves a wrong answer later.
A worked example: add, subtract, and multiply in hex
First, the default example: A3 plus 1F. In decimal, A3 is 163 and 1F is 31, and 163 plus 31 is 194. In hex, 194 is C2, because 12 times 16 plus 2 is 194, so the hex result is C2 and the decimal result is 194.
Second, A3 minus 1F. In decimal, A3 is 163 and 1F is 31, and 163 minus 31 is 132. In hex, 132 is 84, because 8 times 16 plus 4 is 132, so the hex result is 84 and the decimal result is 132.
Third, A times 2. In decimal, A is 10, and 10 times 2 is 20. In hex, 20 is 14, because 16 plus 4 is 20, so the hex result is 14 and the decimal result is 20. The answer looks like fourteen, but in hex it means twenty.
The pattern is that every hex operation can be checked in decimal: convert the inputs, do the arithmetic, and convert the answer back. The hex and decimal answers must agree, and when they do not, the hex working has a slip in it, usually a letter value or a carry.
Where hexadecimal is used
Hex is the standard way to write colours on the web: a colour like #FF5733 is three bytes in hex, one each for red, green, and blue. Memory addresses, error codes, and file signatures are written in hex too, because one hex digit stands for exactly four binary digits, so a byte is always two hex digits.
Programmers also use hex for bit flags, where each bit switches a feature on or off, and for Unicode code points, which name every character in every language. An exponent calculator helps with the place values, since each hex place is a power of 16, and a scientific calculator handles the decimal side of the same problem. A scientific calculator and a exponent calculator sit next to this kind of work in most maths toolboxes, and people often use two or three of them together on the same problem.
In school, hex is usually the third number system students meet, after decimal and binary, and it teaches place value in its most general form: the base can be anything, and the digits and place values follow from the base. A student who can convert A3 to 163 understands place value properly.
Try a few values yourself once you have read the worked examples, changing one input at a time and watching how the answer moves, then check one result by hand with the method above before you trust the screen. That habit, one hand check for every new kind of problem, is what turns a quick answer into real understanding, and it catches the typing slips that no calculator can catch for you.
Hexadecimal calculator vs a binary calculator
A hexadecimal calculator works in base 16, with sixteen digits, while a binary calculator works in base 2, with two digits. The two systems are closely related, because each hex digit is exactly four binary digits, so converting between them is a matter of regrouping, not arithmetic. A power calculator answers a different question, so the two tools complement each other rather than competing.
Use this calculator when the numbers are written in hex, for colours, addresses, or code. Use a binary calculator when the numbers are written as bit patterns, for logic gates or networking. Hex is the compact way to write binary, and binary is the detailed way to write hex.
Hex pairs naturally with powers and logarithms, since hex place values are powers of 16, and a logarithm to base 16 answers how many hex digits a number needs, which is a question that comes up in memory and addressing. A logarithm calculator is another tool people reach for on the same kind of problem, and keeping the three together covers most everyday cases.
Common hexadecimal mistakes
The most common mistake is treating A as 1 instead of 10. A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15, and forgetting that makes every hex number wrong. Writing the letter values out before starting is the simplest fix.
The second mistake is carrying at 10 instead of 16. In hex, a column carries when it reaches 16, not 10, so 3 plus F is 18 in decimal, which is 12 in hex, and you write 2 and carry 1. Carrying at 10 is a decimal habit that does not belong in hex.
The third mistake is reading a hex answer as a decimal number. C2 looks like a code, but 14 in hex means 20 in decimal, not fourteen, and 84 in hex means 132, not eighty-four. Always check which base an answer is written in before using it.
The fourth mistake is using a letter beyond F. Hex stops at F, which is 15, so a G or a Z in a hex number is invalid, not a larger digit. This calculator shows a dash for such inputs, which is the correct response to a digit that does not exist in the base.
How to use this hexadecimal calculator
Type the first hex number in the top box and the second in the next box, using digits 0 to 9 and letters A to F, then pick Add, Subtract, or Multiply. The hex result and the decimal result appear at once, and both update live as you type.
Read the hex result first, then the decimal result underneath it, which is the same answer in ordinary numbers. If the hex result shows a dash, check the inputs for a letter beyond F, or for a subtraction that goes below zero.
If an answer surprises you, check the input first, then run the worked example from this page through the calculator and confirm it gives the same result. When the known example is right and your own input is right, the answer is right, and that two-step check settles almost every disagreement between a person and a calculator.
Nothing you type leaves your device, so you can use the hexadecimal calculator as often as you like, for homework, for work, or just to settle an argument. Bookmark the page and it is ready whenever the next number needs checking.