Hexadecimal Calculator
Hexadecimal, or base 16, is the numbering system used almost everywhere in computing: memory addresses, colour codes, machine instructions, network identifiers and debugging output all appear in hex. The digits run from 0 to 9 and then A to F, where A represents 10, B is 11, and so on up to F which is 15. Because 16 is a power of 2, each hex digit maps exactly to four binary bits, making the system far more compact and readable than raw binary while remaining unambiguous. Doing arithmetic directly in hex is a skill that programmers, embedded systems engineers and computer science students use regularly, but carrying and borrowing across the A-to-F range is error-prone by hand. This calculator lets you enter two hexadecimal values and choose an operation: addition, subtraction or multiplication. It returns the result in hexadecimal, converts it to decimal and binary, and shows the operands in all three bases for verification. Unlike a simple hex-to-decimal converter, this tool performs the arithmetic itself. Upper and lower case are both accepted for the hex digits A through F. Results are signed integers, so a subtraction that produces a negative value will display with a minus sign. Enter your two hex values and choose the operation to see the result instantly. The worked example below uses the defaults already filled in.
How it works
The calculator converts each hex input to a decimal integer using JavaScript's built-in parseInt with base 16. It then applies the selected arithmetic operation (addition, subtraction or multiplication) in decimal, and converts the result back to hex using the toString(16) method, with the output forced to upper case. The decimal result is shown as-is, and the binary equivalent is produced via toString(2). Both input values are also shown in decimal so you can verify the conversion at a glance. If either input contains characters outside 0-9 and A-F, the calculator shows an error rather than producing a misleading result.
Worked example
First value A3 is 10 times 16 plus 3, which equals 163 in decimal. Second value 1F is 1 times 16 plus 15, which equals 31 in decimal. Adding: 163 plus 31 equals 194 in decimal. Converting 194 back to hex: 194 divided by 16 is 12 remainder 2, and 12 in hex is C. So the result is C2 in hexadecimal. In binary, 194 is 11000010. These match the defaults pre-filled above.
Related calculators
- Bitwise Calculator: AND, OR, XOR and NOT operations on integers shown in binary.
- File Size Converter: convert between bytes, kilobytes, megabytes and gigabytes.
- Base64 Encoder/Decoder: encode and decode text using Base64.
- Color Picker: convert hex colour codes to RGB and HSL.