Skip to content
Everydaybudgeting

Roommate Expense Splitter

Who owes whom after shared expenses, minimising the number of transfers. Balances always sum to zero, which is the check that the arithmetic is right.

Also called: split expenses calculator, who owes who.

Equal shares by default; change for an uneven split.

Who pays whom
person 2 pays person 1 3733.33; person 3 pays person 1 33.33

person 2 pays person 1 3733.33; person 3 pays person 1 33.33. Total shared spending was $24,700.00 across 3 people, so each owed $8,233.33 on the shares given. The balances are 3766.67, -3733.33, -33.33 and sum to zero, which is the check that the arithmetic holds. 2 transfer(s) settle it.

Total shared spending
$24,700.00
Fair share each
$8,233.33
Each person is owed or owes
3766.67, -3733.33, -33.33
Most owed to one person
$3,766.67
Most owed by one person
$3,733.33
Transfers to settle
2
On settling
The balances are 3766.67, -3733.33, -33.33 and sum to zero, which is the check that the arithmetic holds. 2 transfer(s) settle it.
Method and background

How this is calculated

Each person's balance is what they paid less what they owed on their share. Positive balances are creditors and negative ones debtors, and the two always sum to zero. Settling is then a matching problem: pairing the largest debtor with the largest creditor repeatedly produces at most one fewer transfer than there are people, which is far fewer than everyone paying everyone. Personal expenses are excluded from the shared pool first, since they were never shared.

each balance is what was paid less what was owed, and the balances always sum to zero
p
Paid
s
Share

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

three people, uneven paying

People
3
Amount each person paid
12000, 4500, 8200
Share each person owes
1, 1, 1
Some expenses were personal
No
Personal amounts to exclude
0, 0, 0

Who pays whomperson 2 pays person 1 3733.33; person 3 pays person 1 33.33

24,700 over three; two transfers settle three people

Open this example

everyone already square

People
3
Amount each person paid
8000, 8000, 8000
Share each person owes
1, 1, 1
Some expenses were personal
No
Personal amounts to exclude
0, 0, 0

Who pays whomeveryone is already square

boundary

Open this example

Method and limits

What it assumes

  • All listed spending is shared unless excluded.

What it deliberately does not model

  • The greedy settlement is near-optimal rather than provably minimal, though it is optimal for most small groups.
  • Uneven shares are a fairness judgement that the arithmetic cannot make for you.

Formula version 1.0.0 · definition 1.0.0 · United States · Report a problem with this calculator

Frequently asked questions

Why do the balances sum to zero?
Because every rupee paid was owed by someone. If they do not sum to zero the inputs are wrong, which makes it a useful check.
What is the fewest transfers needed?
At most one fewer than the number of people. Pairing the largest debtor with the largest creditor repeatedly gets there, rather than everyone settling with everyone.