The maths
How to calculate who owes who
There are only three steps: what each person paid, what each person owed, and the difference. The clever part is turning those differences into as few payments as possible.
Who this is for: Anyone who wants to check the numbers by hand, or understand what a calculator is doing.
Short answer
Work out what each person paid, what each person's fair share was, subtract one from the other to get a net balance per person, then repeatedly pay the largest debtor to the largest creditor until every balance is zero.
Step by step
- 1Add up what each person actually paid out.
- 2Add up each person's fair share of every expense they took part in.
- 3Net balance = paid minus share. Positive is owed money, negative owes money.
- 4Match the largest negative against the largest positive and transfer the smaller of the two.
- 5Repeat until every balance is zero. This needs at most one payment fewer than the number of people; spotting people whose balances cancel exactly can save more.
"Who owes who" only feels complicated because people try to reverse-engineer it from a pile of individual IOUs โ Ana owes Ben, Ben owes Cleo, Cleo owes Ana. Untangling that by hand is genuinely hard. Netting it first makes it trivial.
The trick is to stop thinking about pairs of people and start thinking about each person's single net balance against the group as a whole. Once you have that one number per person, settling is a matching problem, not an algebra problem.
This is exactly what a group expense calculator automates, but the method is simple enough to do on paper for small groups, and understanding it makes it obvious why the app's settlement list is short rather than an arbitrary tangle of refunds.
Worked examples with real numbers
Five people, one weekend of costs
Priya, Quinn, Ravi, Sara and Tom shared costs totalling 400. Priya paid 220, Sara paid 140, Quinn paid 40, and Ravi and Tom paid nothing.
| Totals | Amount |
|---|---|
| Total spent | 400.00 |
| Fair share per person (400 รท 5) | 80.00 |
| Person | Paid | Fair share | Balance |
|---|---|---|---|
| Priya | 220.00 | 80.00 | +140.00 |
| Quinn | 40.00 | 80.00 | โ40.00 |
| Ravi | 0.00 | 80.00 | โ80.00 |
| Sara | 140.00 | 80.00 | +60.00 |
| Tom | 0.00 | 80.00 | โ80.00 |
- RaviPriya80.00
- TomPriya60.00
- TomSara20.00
- QuinnSara40.00
Balances are +140 (Priya), +60 (Sara), โ40 (Quinn), โ80 (Ravi), โ80 (Tom). Matching the largest debtor to the largest creditor each round produces four transfers โ one fewer than the five people involved.
Three people, a small shared cost
Iris, Jae and Kim spend 54 on snacks for a film night. Iris paid the whole thing.
| Totals | Amount |
|---|---|
| Total spent | 54.00 |
| Fair share per person (54 รท 3) | 18.00 |
| Person | Paid | Fair share | Balance |
|---|---|---|---|
| Iris | 54.00 | 18.00 | +36.00 |
| Jae | 0.00 | 18.00 | โ18.00 |
| Kim | 0.00 | 18.00 | โ18.00 |
- JaeIris18.00
- KimIris18.00
When one person paid for everyone, the answer is always the same shape: everyone else pays that person their share directly. Two transfers for three people โ never more than nโ1.
The balance-and-match method
1. 1. Total paid per person
sum every expense by who paid it
2. 2. Total share per person
sum each person's fair portion of every expense they were part of
3. 3. Net balance
balance = paid โ share (positive = owed, negative = owes)
4. 4. Check it nets to zero
sum of all balances = 0, always
5. 5. Match
pay the largest debtor's balance to the largest creditor, capped at min(|debt|, credit)
6. 6. Repeat
update both balances and repeat until every balance is 0
This largest-first method never needs more than nโ1 transfers for n people. It is not always the absolute minimum: if some people's balances cancel exactly (say +30 and โ30), settling them separately saves a transfer. The calculator checks for those combinations automatically.
Payments needed: naive vs simplified
| People | Naive (settle every pair) | At most (nโ1) |
|---|---|---|
| 3 | 3 | 2 |
| 4 | 6 | 3 |
| 5 | 10 | 4 |
| 6 | 15 | 5 |
| 8 | 28 | 7 |
| 10 | 45 | 9 |
Naive is nร(nโ1)รท2 possible pairwise debts; simplified is at most nโ1 transfers.
Mistakes that cause arguments
Settling debts as they're mentioned
Paying back each individual IOU as someone remembers it produces far more transfers than necessary and often the wrong amounts once later expenses shift the balance.
Forgetting to include the payer in their own share
The person who paid for dinner still ate dinner โ their share still counts against them, it's just offset by what they paid.
Assuming balances must be round numbers
Real shares often produce numbers with cents. That's fine โ the balances still net to zero, they just aren't tidy.
Matching arbitrarily instead of largest-to-largest
Any valid matching that clears all balances works, but largest-to-largest reliably keeps the list short.
Practical tips
- Always calculate share, not just spend, per person.
- Balance = paid minus share, not paid minus average paid.
- Sanity-check that every group's balances sum to zero before settling.
- Sort debtors and creditors by size before matching them.
- Let a calculator do the matching once the group is bigger than four or five people โ it's mechanical but easy to slip up on by hand.
Questions
Why not just have everyone pay everyone?
Because that multiplies transfers. Netting balances first typically cuts the number of payments in half or better.
What if the numbers do not reach exactly zero?
Rounding to two decimals can leave a cent or two. Round the final payment; nobody chases a cent.
Does the order of payments matter?
No. Any set of transfers that zeroes every balance is valid โ a shorter one is just more convenient.
