Johan Alphonso Braga
WorkProjectsReadingStackCraftDesignStatusResume

Utilities

Ask anything

Elsewhere

GitHub

All projects

Tools / 2026 / Live in the browser

EvenUp

Split costs with friends and settle up in the fewest payments. EvenUp writes the pay-me-back message for you, and Penny, a coin mascot, helps along the way. No sign up, nothing leaves the phone.

EvenUp

01

The problem

After a trip or a dinner, someone has to work out who owes who and then ask for the money. A third of UK adults are owed money by friends or family and 46% feel too awkward to ask for it back. The best-known app for splitting caps how many costs free users can add per day. And paying everyone back directly turns one weekend into a pile of small transfers.

02

How I approached it

All money is whole cents, and every split uses the largest remainder method so the parts always add back up, with the odd cent rotating between people. Settling in the fewest payments is NP-hard (Verhoeff 2004), but the answer is n minus the most groups the people split into that each sum to zero, so a dynamic program over subsets solves it exactly for up to 16 people in a few milliseconds and falls back to a greedy pass beyond that. A share link packs the whole split into the URL fragment, which browsers never send to a server, and every field is checked on the way in because a link can come from anyone. The page runs under connect-src 'none'. Penny is an inline SVG with mood states driven by the app: her eyes track the pointer or the focused field, she hops and gives a tip for the current step when tapped, reacts to each action through an aria-live bubble, and holds still under prefers-reduced-motion.

03

The outcome

Equal, by-shares and exact-amount splits, who-pays-who with paid ticks, a per-person message and a group-chat summary, share links, edit and undo. On balances of +5, +7, +4, +4, -5, -7, -8 the common biggest-pays-biggest method takes 6 payments and EvenUp finds 4. 19 tests with no dependencies cover parsing, rounding on every split up to 20.00 across 1 to 9 people, a brute-force check of the fewest-payments answer on 400 random groups, and every way a bad share link can fail.

evenup.johanthegoat.xyz Open in a new tab ↗
Next projectAntiphon →