Math calculators

Difference Calculator

Updated Aug 5, 2026 By Jehan Wadia
Rate Formulas
Compare Two Values
Shown in results and the worked solution.
Accepts negatives, decimals and zero (e.g. -12.5).
Leave blank to use "Value B".
Accepts negatives, decimals and zero (e.g. 1,250.75).
Swaps both values and labels, then recalculates.
Applies when a value is ≥ 1×10¹² or smaller than 1×10⁻⁶.
What This Means
All Difference Results
Absolute Difference
The raw distance between A and B, ignoring direction.
Actual Difference (Signed)
Directional difference from A to B. Negative means B is smaller.
Percentage Difference
Symmetric measure — compares the gap to the average of A and B.
Percentage Change (A → B)
Uses A as the baseline / original value.
Percentage Change (B → A)
Uses B as the baseline / original value.
Ratio A : B
A expressed in proportion to B (simplified where possible).
Ratio B : A
B expressed in proportion to A (simplified where possible).
Average (Mean) of A & B
The midpoint between the two values.
Visual Comparison
Bar lengths are scaled by absolute magnitude; exact values are printed beside each bar.
Step-by-Step Solution
Additional Pairs (Batch Mode)
Add up to 10 extra A/B pairs. Each pair is calculated independently.

Introduction

This Difference Calculator shows you how far apart two numbers are. Type a first value (A) and a second value (B), and the tool does the math for you. It works with whole numbers, decimals, negative numbers, and zero.

You get more than one answer, because "difference" can mean a few things:

  • Absolute difference – the plain gap between A and B, with no plus or minus sign.
  • Actual (signed) difference – shows if B went up or down from A.
  • Percentage difference – compares the gap to the average of both numbers.
  • Percentage change – how much A grew or shrank to become B (and the other way around).
  • Ratios and the average – A to B, B to A, and the midpoint of the two.

Each answer comes with the math written out, so you can see how it was found. A step-by-step solution and simple bar charts help you check your work or study for a test. You can also add up to 10 more pairs in batch mode to compare many numbers at once, pick how many decimal places you want, and swap A and B with one click.

People use this tool to compare prices, test scores, sales, weights, temperatures, and any two numbers that need a quick, clear answer.

How to use our Difference Calculator

Type in two numbers and the calculator shows the difference between them, plus the percent difference, percent change, ratios, and average. It also gives you a step-by-step solution and charts.

Label for A: Give your first number a name, like "Price Before." This name shows up in the results. You can leave it blank.

Value A: Enter your first number, or the original value. You can use negatives, decimals, zero, or commas, like -12.5 or 1,250.75.

Label for B: Give your second number a name, like "Price After." If you leave it blank, it just says "Value B."

Value B: Enter your second number, or the new value. The same number rules apply here.

Swap A & B: Click this to trade places between your two numbers and their labels. The results update right away.

Decimal Places: Pick how many digits show after the decimal point, from 0 to 5. Use 0 for whole numbers, or try the Rounding Calculator for more rounding rules.

Thousands separators: Turn this on to show commas in big numbers, like 1,234.56. Turn it off for plain digits.

Scientific notation: Turn this on to shorten very big or very tiny numbers. It kicks in at 1×10¹² and above, or below 1×10⁻⁶. See our Scientific Notation Calculator to work with these forms directly.

Calculate: Click this to get your answers. The results also update as you type.

Reset: Click this to clear your work and go back to the sample numbers.

Additional Pairs (Batch Mode): Click "Add Another Pair" to compare up to 10 more sets of numbers at once. Fill in each Value A and Value B, then click "Calculate All" to see every result and a side-by-side chart.

What Is the Difference Between Two Numbers?

The difference between two numbers is how far apart they are. You find it by subtracting one number from the other. If you have 75 and 85, the difference is 10. That simple idea has a few useful forms, and each one answers a different question.

Absolute Difference

The absolute difference is the gap between two values with no plus or minus sign. You write it as |A − B|. For 75 and 85, it is 10. Use it when you only care how big the gap is, not which number is bigger.

Actual (Signed) Difference

The signed difference is B − A. It keeps the sign, so it tells you direction. A positive answer means B went up from A. A negative answer means B went down. For 75 to 85, the signed difference is +10, an increase.

Percentage Difference

Percentage difference compares the gap to the average of the two numbers:

|A − B| ÷ average of A and B × 100

It is symmetric. That means you get the same answer no matter which number you list first. Use it when neither number is the "starting" one, like comparing two lab readings or two store prices. If you are checking a measurement against a known correct value instead, the Percent Error Calculator is the better fit.

Percentage Change

Percentage change needs a starting value, called the baseline:

(new − old) ÷ |old| × 100

Going from 75 to 85 is a 13.33% increase. Going from 85 back to 75 is an 11.76% decrease. The two answers are not the same, because the baseline changed. Always say which number you started from. For one-way math, see the Percentage Increase Calculator and the Percentage Decrease Calculator. To measure change per unit of time or per step, try the Rate of Change Calculator.

Ratios and the Mean

A ratio shows the two numbers side by side in their smallest whole-number form. 75 and 85 becomes 15 : 17. The tool divides both sides by the greatest common factor to simplify. The mean, or average, is the midpoint: (75 + 85) ÷ 2 = 80. Need the middle value of a longer list instead? Use the Mean Median Mode Calculator.

When Percent Cannot Be Found

You cannot divide by zero. So if the baseline is 0, the percentage change has no answer. If the average of the two numbers is 0, the percentage difference has no answer either. In those cases, use the absolute or signed difference instead.

Where People Use This

Quick Tips

  • Negative numbers are fine. Subtracting a negative adds: 5 − (−3) = 8.
  • Percent change of +50% then −50% does not bring you back to the start.
  • Round only at the end so small errors do not build up. The Sig Fig Calculator helps when precision matters.
  • A big percent can still be a tiny amount, and a small percent can be a huge amount. Look at both. A plain Percentage Calculator is handy for spot checks.
  • To spread differences across weighted items, see the Weighted Average Calculator.

Formulas used

Absolute Difference
|A - B|
Actual (Signed) Difference
\Delta = B - A
Average (Mean) of A and B
\bar{x} = \frac{A + B}{2}
Percentage Difference (symmetric)
\text{\%\,diff} = \frac{|A - B|}{\left|\frac{A + B}{2}\right|} \times 100
Percentage Change from A to B
\text{\%\,change} = \frac{B - A}{|A|} \times 100
Percentage Change from B to A
\text{\%\,change} = \frac{A - B}{|B|} \times 100
Ratio A to B (simplified by GCD)
A : B = \frac{A}{\gcd(A,B)} : \frac{B}{\gcd(A,B)} = \frac{A}{B} : 1

Frequently asked questions

Does the order I enter A and B matter?

It matters for some results and not for others.

  • Same either way: absolute difference, percentage difference, and the average.
  • Changes: the signed difference, both percentage changes, and the ratios.

Put the older or starting number in A and the newer number in B. Use the Swap A & B button to flip them and see both views.

Why is the signed difference B minus A instead of A minus B?

Because A is treated as the starting value. Subtracting A from B tells you which way the number moved.

  • Positive: B is bigger, so the value went up.
  • Negative: B is smaller, so the value went down.

If you want A minus B, just click Swap A & B.

Which one should I use: percentage difference or percentage change?

Pick by asking if one number is a starting point.

  • Percentage change: use it when one number came first, like last year's sales versus this year's sales.
  • Percentage difference: use it when neither number is first, like two scales weighing the same box.

Can I type dollar signs, percent signs, or units?

No. The boxes accept digits, a minus sign, a decimal point, and commas. Type 1,250.75, not $1,250.75. Put the unit in the label box instead, like "Price in USD." Both numbers must use the same unit or the answer will not make sense.

Can I enter a fraction like 3/4?

No. Change the fraction to a decimal first. So 3/4 becomes 0.75 and 1 1/2 becomes 1.5. Then set Decimal Places high enough so the answer is not rounded too much.

Why does my ratio show as 1.13 : 1 instead of two whole numbers?

Some pairs cannot be shortened to small whole numbers. That happens with long decimals or numbers that share no common factor. When that is the case, the tool divides one value by the other and shows the answer against 1. It means the same thing, just in decimal form.

Does changing the decimal places change the math?

No. The calculator always works with your full numbers. Decimal Places only changes how the answers look on screen. So a tiny rounded result may show as 0.00 even though it is not exactly zero. Raise the decimal places to see more digits.

What happens if both of my numbers are zero?

The absolute difference and signed difference are both 0, and the average is 0. The percentages and ratios show Undefined, because you cannot divide by zero. That is correct math, not an error.

Why is my percentage change positive when both numbers are negative?

Because the value moved up, even though it is still below zero. Going from -10 to -5 is a rise of 5, which is a 50% increase. The tool divides by the size of the baseline, so the sign of the answer shows the true direction of the move.

Is the absolute difference the same as distance on a number line?

Yes. The absolute difference is how many steps apart the two numbers sit on a number line. From -3 to 4 the distance is 7, and the calculator shows 7. Distance is never negative.

Can I compare three or more numbers at once?

Not in one set. This tool compares two numbers at a time. Batch mode lets you add up to 10 more pairs, but each pair is worked out on its own. To study one long list of numbers, use an average or median tool instead.

What is the difference between percent and percentage points?

They are not the same. If a rate goes from 20% to 30%:

  • The gap is 10 percentage points (that is the absolute difference).
  • The rise is 50% (that is the percentage change).

Enter 20 and 30, then read both results and use the one that fits your question.

Do the bar charts work with negative numbers?

The bar lengths are drawn by size only, so a -40 bar looks as long as a 40 bar. The exact number, minus sign and all, is printed next to each bar and in the results cards. Read the numbers for the sign.

Why do the results change while I am still typing?

The calculator updates live so you can see answers right away. If a box is empty or has a typo, a red message appears and that pair waits until both numbers are valid. You can still press Calculate or the Enter key any time.

How can I check the answer by hand?

Use two quick steps:

  • Subtract the smaller number from the bigger one to get the absolute difference.
  • Divide that gap by the starting number, then multiply by 100 for the percent change.

Example: 85 - 75 = 10, and 10 ÷ 75 × 100 = 13.33%. The Step-by-Step Solution box shows every line of this work.

Are my numbers saved or sent anywhere?

No. All the math runs in your browser. Nothing is stored or uploaded. If you reload the page or press Reset, your numbers are cleared and the sample values come back, so copy any results you want to keep.