A percentage difference calculator uses the mean of the two values instead. It gives a symmetric result: switching A and B leaves the answer unchanged. Keep the absolute gap and denominator visible so the percentage remains explainable.

Work through the gap and the mean
For two comparable nonnegative values A and B, with a nonzero mean:
Absolute gap = |A − B|
Mean = (A + B) / 2
Percentage difference = absolute gap / mean × 100%
The EPA's archived relative-percent-difference definition uses the absolute difference divided by the average, multiplied by 100. Here we use that mathematical definition for an original duration comparison; no environmental measurement rules or acceptance thresholds are being applied. EPA relative percent difference definition
Both fictional proposals describe the same task duration in minutes:
| Comparison field | Worked value |
|---|---|
| A | 40 minutes |
| B | 50 minutes |
| Absolute gap | 10 minutes |
| Mean | 45 minutes |
| Calculation | 10 / 45 × 100% |
| Exact result | 200/9% |
| Rounded to six decimal places | 22.222222% |
The gap and mean both carry minutes. Their ratio has no unit. The result describes separation relative to the shared mean; it does not establish which proposal is better or which duration will occur in practice.
Swap the inputs to A = 50 and B = 40. The absolute gap remains 10 and the mean remains 45, so the result remains 22.222222%. A tool that changes this result when you swap the values is answering a different question or calculating incorrectly.
Choose the question before the denominator
| Question | Denominator or operation | Result for 40 and 50 |
|---|---|---|
| How different are two unordered comparable values? | Gap divided by their mean, 45 | 22.222222% difference |
| What is the change from an old value of 40 to a new value of 50? | Signed change divided by old value, 40 | 25% increase |
| What is the gap between rates of 40% and 50%? | Subtract the percentage values | 10 percentage points |
The directional calculation is (50 − 40) / 40 × 100% = 25%. Reversing that direction gives (40 − 50) / 50 × 100% = −20%. Those results intentionally depend on the baseline. They should not replace the symmetric calculator's output.
A percentage-point gap concerns two rates, rather than the two minute values in this example. Keep that label explicit: 10 percentage points is not a 10% symmetric difference.
Confirm comparable inputs
Use the same unit and quantity basis for both entries. Forty hours and 50 minutes cannot be compared by typing the raw numbers 40 and 50; first make and verify the unit conversion. Likewise, a duration for one task and a duration for a different task do not automatically form a useful comparison.
This example accepts finite values from 0 through 1,000,000, with at most six decimal places and a US decimal point. That is an original input scope, not a claim about another calculator's limits. The common unit and meaning require confirmation; the tool does not recognize or convert units automatically.
Keep Celsius readings outside this tool's scope. Their scale origin makes this relative comparison a different problem from comparing task durations. Do not attach a quality, improvement or precision threshold to the result without a separately justified criterion.
Check normal and stopping cases
| A | B | Gap | Mean | Expected result |
|---|---|---|---|---|
| 40 | 50 | 10 | 45 | 22.222222% rounded |
| 50 | 40 | 10 | 45 | Same result after swap |
| 80 | 100 | 20 | 90 | 22.222222% rounded |
| 90 | 110 | 20 | 100 | 20% |
| 45 | 45 | 0 | 45 | 0% |
| 0 | 50 | 50 | 25 | 200% |
| 0 | 0 | 0 | 0 | Undefined: zero denominator |
Doubling 40 and 50 to 80 and 100 doubles both gap and mean, leaving the ratio unchanged. A zero paired with a positive value produces 200% under this nonnegative definition. It is a valid arithmetic result, not a directional “200% increase from zero.”
Both-zero inputs must show undefined, even though the gap is zero. Blank input is not zero. Negative, nonfinite, out-of-range or overly precise entries must produce a labeled input error rather than a result. When an entry becomes invalid, clear the previous gap, mean and percentage so a stale answer cannot be mistaken for the new comparison.
Copy this prompt for the calculator specification
Prepare an original specification and worked comparison ledger for a local percentage difference calculator in US English. Do not implement or claim a tested tool, collect data or add performance/quality thresholds.
Inputs A/B must represent the same quantity basis and common unit, confirmed by the user. Each is finite, nonnegative, 0 through 1,000,000 inclusive, with up to six decimal places using a US dot decimal. Blank is invalid, not zero. Reject negative, nonfinite, out-of-range and excessive-decimal inputs. Do not guess or convert units; exclude Celsius comparisons from this scope.
Show |A-B|, (A+B)/2 and |A-B|/mean*100%. Label the gap/mean with the common unit and the ratio as dimensionless. For a zero mean show undefined, not 0%. Label rounded results to six decimal places and include exact derivation where useful. On invalid input clear stale gap, mean and percent output and show the reason beside the input.
Original example: two independently proposed durations for the same task, A = 40 and B = 50 minutes, not old/new measurements. Gap = 10, mean = 45, exact result = 200/9%, rounded result = 22.222222%. Swapping to 50/40 gives the same result. Audit pairs: 80/100 gives the same 22.222222%; 90/110 gives 20%; 45/45 gives 0%; 0/50 gives 200%; 0/0 is undefined. A later Swap control must exchange actual input values with a real local effect, retaining the symmetric result; implementation and keyboard/state tests remain pending.
Explain that directional 40-to-50 change uses baseline 40 and equals 25%, while 50-to-40 change equals -20%; those are different questions. A gap between 40% and 50% is 10 percentage points, not 10% symmetric difference. No improvement, task equivalence, measured outcome or acceptance claim. Keep the maintained comparison ledger authoritative. No saving of runtime edits or verified integration claimed.
Keep the derivation beside the result
The local HTML example keeps A, B, the common unit, gap, mean and formula together. NOS supports saving and rendering prepared HTML. Keep your maintained comparison ledger as the record of confirmed inputs and results.
Explore NOS to present a prepared comparison. Choose the question and the denominator first, then report the percentage with enough working to explain it.