Calculate the absolute difference between two numbers, percent difference between values, or the time gap between two clock times.
Related Calculators
- Percentage Difference Calculator
- Net Change Calculator
- Percentage Distance Calculator
- Hamming Distance Calculator
- All Math and Numbers Calculators
Absolute Difference Formula
The calculator uses one formula per mode.
Numbers mode:
|a - b|
Percent mode:
%diff = |V1 - V2| / ((V1 + V2) / 2) * 100
Time gap mode:
gap = |T1 - T2| (in minutes on a 24-hour clock)
- a, b: any two real numbers you enter in the Numbers tab.
- V1, V2: two positive values compared in the Percent tab.
- T1, T2: clock times converted to minutes since midnight.
- | |: absolute value, which strips the sign so the result is never negative.
The Numbers tab returns both the absolute difference and the signed difference, so you can see which value is larger. The Percent tab divides the absolute difference by the average of the two values, which is the symmetric percent difference used in lab and statistics work. The Time gap tab converts both times to minutes, then offers three handling options: same day, second time on the next day, or shortest gap on a 24-hour clock.
Reference Tables
Use these to sanity-check the output and pick the right mode.
| First value | Second value | Absolute difference | Percent difference |
|---|---|---|---|
| 10 | 12 | 2 | 18.18% |
| 50 | 75 | 25 | 40.00% |
| 100 | 100 | 0 | 0.00% |
| -4 | 9 | 13 | n/a |
| 2.5 | 3.0 | 0.5 | 18.18% |
| Use case | Pick this mode |
|---|---|
| Compare two prices, scores, or measurements | Numbers |
| Compare two lab readings without a known “true” value | Percent |
| Find minutes between a start and end time | Time gap (same day or next day) |
| Distance between two clock positions | Time gap (shortest) |
Worked Examples
Example 1: Numbers. Your two test scores are 84 and 91. The absolute difference is |84 – 91| = 7 points. The signed difference is -7, which tells you the second score is the larger one.
Example 2: Percent. Two scales report a sample weight as 4.8 kg and 5.2 kg. Absolute difference is 0.4 kg. Average is 5.0 kg. Percent difference is 0.4 / 5.0 × 100 = 8.00%.
FAQ
Is the order of the inputs important? No. Absolute difference is symmetric, so swapping the values gives the same result. Only the signed difference flips sign.
Why does percent mode require positive numbers? The formula divides by the average of the two values. If one value is zero or negative, the average can be zero or misleading, and the percent loses its standard meaning.
What is the difference between percent difference and percent change? Percent change uses the first value as the reference: (V2 – V1) / V1 × 100. Percent difference uses the average of both values as the reference, so neither is treated as the “correct” one.
How does the shortest time gap option work? It treats the clock as a circle. If the raw difference is more than 12 hours, it subtracts from 24 hours. So 23:00 and 01:00 give a 2-hour gap, not 22 hours.
