Enter the sum and difference of two numbers to find both numbers, with a substitution check and their product shown instantly.
Sum Difference Calculator
Give the sum and the difference — get both numbers back, verified by substitution.
Enter your values
Fill in the fields below — the result appears with every step shown.
Your result will appear here
Enter your values above, then press Calculate — or press Enter in any field.TinyExe · Sum Difference Result
Calculated locally in your browser
—
Name
—
Sum of the two numbers (S)
—
Difference of the two numbers (D)
—
Result
—
How this was calculated
What to do next
TinyExe PDF & PNG exports carry the TinyExe logo and tinyexe.com header & footer.
Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.
The short answer
Given a sum S and a difference D, the two numbers are found by halving: the larger number equals S plus D, divided by two, and the smaller equals S minus D, divided by two. For a sum of twenty and a difference of six, the numbers are thirteen and seven.
- Larger = (S + D) / 2 and smaller = (S - D) / 2
- Sum-and-difference always has exactly one solution
- If D exceeds S, the smaller number is negative
Quick sum-and-difference patterns
Reference values for this calculator.
| Sum S | Difference D | Numbers |
|---|---|---|
| 10 | 0 | 5 and 5 |
| 10 | 2 | 6 and 4 |
| 10 | 10 | 10 and 0 |
| 50 | 14 | 32 and 18 |
| 100 | 36 | 68 and 32 |
The formula
The exact formula this calculator uses — every variable in it is explained in the card below.
The formula
Solves the classic two-unknown system x + y = S and x - y = D exactly, instead of the old generic two-number arithmetic. Adding the two equations eliminates y and gives 2x = S + D; subtracting eliminates x. Enhancement: the product and a full substitution check are returned with every answer.
Worked examples
Worked examples with the full working shown — try them in the calculator to check.
Example 1
Sum 20, difference 6
S = 20, D = 6
| Calculation | Steps |
|---|---|
| Larger number a = (S + D) / 2 = (20 + 6) / 2 = 13 Smaller number b = (S - D) / 2 = (20 - 6) / 2 = 7 Verify: 13 + 7 = 20 (the sum) and 13 - 7 = 6 (the difference) | The numbers are 13 and 7 — They add to 20 and differ by 6, exactly as given. |
Result
Example 2
Equal numbers edge case
S = 100, D = 0
| Calculation | Steps |
|---|---|
| Larger number a = (S + D) / 2 = (100 + 0) / 2 = 50 Smaller number b = (S - D) / 2 = (100 - 0) / 2 = 50 Verify: 50 + 50 = 100 (the sum) and 50 - 50 = 0 (the difference) | The numbers are 50 and 50 — They add to 100 and differ by 0, exactly as given. |
Result
Example 3
Decimal sum and difference
S = 15.5, D = 2.5
| Calculation | Steps |
|---|---|
| Larger number a = (S + D) / 2 = (15.5 + 2.5) / 2 = 9 Smaller number b = (S - D) / 2 = (15.5 - 2.5) / 2 = 6.5 Verify: 9 + 6.5 = 15.5 (the sum) and 9 - 6.5 = 2.5 (the difference) | The numbers are 9 and 6.5 — They add to 15.5 and differ by 2.5, exactly as given. |
Result
How to use this calculator
Step 1
Work out or look up the total of the two numbers — that is S.
Step 2
Work out how far apart they are (larger minus smaller) — that is D, entered as a positive number.
Step 3
Press Calculate to get both numbers.
Step 4
Check the verification step: the two answers must add back to S and differ by D.
Step 5
If D is bigger than S, expect the smaller number to be negative — that is correct behaviour for this system of equations.
Frequently asked questions
How do you find two numbers given their sum and difference?
Add the sum and difference and halve the result for the larger number; subtract the difference from the sum and halve for the smaller. This works because adding x + y = S and x - y = D gives 2x = S + D.
What if the difference is larger than the sum?
The smaller number comes out negative — for example sum 10 and difference 14 gives 12 and -2. That is the mathematically correct solution to the system, and often a sign in word problems that the difference was measured the other way round.
What if the difference is zero?
Both numbers equal half the sum. Difference zero simply means the two numbers are identical.
Is this the same as sum and product (Vieta) problems?
No. Sum-and-product problems (find numbers with a given sum and product) need a quadratic and may have no real answer; sum-and-difference always has exactly one solution, found with the two halving formulas here.
Can I use decimals and negatives?
Yes — the formulas are plain algebra, so decimal sums and differences work, and a negative sum is fine. Only the difference is expected as larger-minus-smaller (0 or more) so the two numbers are labelled consistently.
About this calculator
The Sum Difference Calculator recovers two unknown numbers when you know only their sum and their difference. It adds and subtracts the two totals and halves each result, returning the larger and smaller numbers together with their product and a substitution check.
The puzzle looks under-determined — infinitely many pairs add to 20 — until the difference pins it down: only one pair adds to 20 AND sits 6 apart. Algebraically you are solving x + y = S together with x - y = D. Adding the equations deletes y entirely, leaving 2x = S + D; subtracting them deletes x, leaving 2y = S - D. Halving gives the two formulas this calculator uses.
Because the method is exact, the answer can be checked completely: the two numbers must reproduce both the sum and the difference you entered, and the calculator performs that verification in its steps every time. If the check ever failed, the inputs — not the maths — would be the place to look.
The edge cases teach the most. Difference zero forces two equal numbers; a difference equal to the sum makes the smaller number zero; a difference larger than the sum pushes the smaller number negative, which is perfectly valid algebra and a common trap in word problems where the "difference" was actually recorded the wrong way round.
Use it for classic algebra word problems, splitting a total unevenly between two people, working out two measurements that must add to a fixed length or weight, and checking "think of two numbers" puzzles.
How to calculate it yourself
Step 1
Call the larger number x and the smaller y, so x + y = S and x - y = D.
Step 2
Add the equations: 2x = S + D, so x = (S + D) / 2.
Step 3
Subtract the equations: 2y = S - D, so y = (S - D) / 2.
Step 4
Verify by adding your two answers (must equal S) and subtracting them (must equal D).
Real-life examples
Splitting a bill unevenly
Two friends spent 84 in total on a meal out, and one ate 12 more worth of food than the other. Their individual shares are the two numbers with sum 84 and difference 12.
Larger number a = (S + D) / 2 = (84 + 12) / 2 = 48 Smaller number b = (S - D) / 2 = (84 - 12) / 2 = 36 Verify: 48 + 36 = 84 (the sum) and 48 - 36 = 12 (the difference)
The numbers are 48 and 36 — They add to 84 and differ by 12, exactly as given.
Two boards from one length
A carpenter cuts a 96-inch board into two pieces where one piece must be 14 inches longer than the other — sum 96, difference 14.
Larger number a = (S + D) / 2 = (96 + 14) / 2 = 55 Smaller number b = (S - D) / 2 = (96 - 14) / 2 = 41 Verify: 55 + 41 = 96 (the sum) and 55 - 41 = 14 (the difference)
The numbers are 55 and 41 — They add to 96 and differ by 14, exactly as given.
Ideas & use cases
- Uneven split finder: any total shared "so one person gets a fixed amount more" is a sum-and-difference problem — solve it here instead of trial and error.
- Puzzle maker: pick any two numbers, note their sum and difference, and challenge someone — then use the checker step to mark their answer.
- Measurement recovery: when a combined length and the overlap/gap between two pieces are known, the two piece lengths fall straight out of this tool.
Limitations & sources
- Solves exactly two numbers from one sum and one difference. It does not solve sum-and-product problems or systems with three or more unknowns.
Sources: Simultaneous linear equations method: standard algebra references (OpenStax Elementary Algebra, solving systems by elimination)
