Hex Calculator
Perform hexadecimal (base-16) arithmetic and instantly view results in hexadecimal, decimal, binary and octal. Supports large whole numbers, negative results and common arithmetic operations.
Calculate hexadecimal numbers
Convert between number bases
How to use this hex calculator
- Enter the first hexadecimal number.
- Choose an arithmetic operation.
- Enter the second hexadecimal number and select Calculate.
- Read the exact result in hex, decimal, binary and octal.
What is hexadecimal?
Hexadecimal is a base-16 number system. It uses the digits 0–9 and letters A–F, where A represents 10, B represents 11, and F represents 15. Each hexadecimal digit corresponds to four binary bits, making hex a compact way to represent data in computing.
It is commonly used for memory addresses, programming, digital electronics and colour values.
Hexadecimal formula
To convert a hexadecimal number to decimal, multiply each digit by 16 raised to its position, counting from zero on the right.
Decimal value = Σ (digit × 16position)
For example, 2F in hexadecimal is 2 × 16 + 15 = 47 in decimal.
Example calculation
1A + 05 = 1F in hexadecimal.
In decimal, 1A equals 26 and 05 equals 5. Their sum is 31, which is 1F in base 16. This calculator performs the calculation and converts the result automatically.
Frequently asked questions
What numbers can I enter?
Enter whole hexadecimal numbers using 0–9 and A–F. Uppercase and lowercase letters are both accepted, and the 0x prefix is optional. Negative numbers are supported.
Can the result be negative?
Yes. For subtraction, if the first number is smaller than the second, the result is shown with a leading minus sign.
How does division work?
Division returns the whole-number quotient, truncating toward zero. The remainder is also displayed when applicable.
What is the difference between hex and decimal?
Decimal uses ten digits (0–9), while hexadecimal uses sixteen symbols (0–9 and A–F). For example, decimal 16 is hexadecimal 10.
Are my calculations exact?
Yes. The calculator uses JavaScript BigInt for integer arithmetic, avoiding floating-point rounding for large whole numbers. Calculations happen in your browser.