Hexadecimal Arithmetic Calculator Formula
Understand the math behind the hexadecimal arithmetic calculator. Each variable explained with a worked example.
Formulas Used
Sum Val
sum_val = a + bDiff Val
diff_val = a - bProd Val
prod_val = a * bDiv Val
div_val = b != 0 ? a / b : 0Mod Val
mod_val = b != 0 ? mod(a, b) : 0Variables
| Variable | Description | Default |
|---|---|---|
a | Number A (decimal) | 255 |
b | Number B (decimal) | 16 |
How It Works
Hexadecimal Arithmetic
Hex Addition/Subtraction
Hex arithmetic works like decimal but in base-16. This calculator accepts decimal inputs (enter the decimal equivalent of your hex number) and displays results in decimal.
Conversions
To convert between hex and decimal, use the Hex to Decimal converter.
Worked Example
Operations on 255 (FF in hex) and 16 (10 in hex).
a = 255b = 16
- 01255 + 16 = 271 (hex: FF + 10 = 10F)
- 02255 - 16 = 239 (hex: FF - 10 = EF)
- 03255 × 16 = 4080 (hex: FF × 10 = FF0)
- 04255 / 16 = 15.9375
- 05255 mod 16 = 15 (hex: F)
Ready to run the numbers?
Open Hexadecimal Arithmetic Calculator