Hex Calculator
Enter two hex numbers and choose an operation.
Operation
AND, OR and XOR compare the numbers digit by digit.
Digits 0–9 and A–F, with an optional 0x; a leading minus sign is allowed.
Digits 0–9 and A–F, with an optional 0x; a leading minus sign is allowed.
Try
Result
You entered
Decimal
Binary
Show the work
Hex to decimal
Each hex digit is worth a power of , counting from at the right, with A to F standing for 10 to 15. Converting both numbers to decimal lets the operation be done with ordinary arithmetic.
Using
Subtraction in decimal
Work out the operation on the decimal values.
Decimal to hex
Divide by again and again, keeping each remainder, until the quotient is . The remainders read from the last to the first are the hex digits, with 10 to 15 written as A to F.
Using
Result
So .