Case study · Build · 2026
S P L I T
The developer sideThe design side
Scan a receipt and send one link. Friends tap what they had, and tax and tip split to the exact cent.
S P L I T splits a restaurant bill from one scanned receipt. Friends tap what they had on a shared link, and tax and tip split to the exact cent. It is built with Next.js, Supabase and the Claude API, with Frankfurter for exchange rates, and it is live at split.andrewlengly.com.

- What it doesSee the developer side
Scans a receipt and sends one link. Friends tap what they had, and tax and tip split to the penny.
- The briefSee the designer side
Let friends split a receipt from their phones, with names that drag or tap onto each item.
The short version
- 01
The idea
Split the tab without the math. One person scans the receipt, and everyone else taps what they had from a link.
- 02
What I did
Built a receipt scanner and a shared bill page on top of split math that adds up to the total. Trips settle many receipts across currencies.
- 03
Where it stands
Live at split.andrewlengly.com. 18 tests cover what comes in from receipts and requests, and the split math has none yet.
What it does
One person scans, and everyone else taps what they had.
Scan
Take a photo of the receipt and Claude reads its line items and totals. You can also type the items in.
Paste
Copy the receipt text with Live Text or Google Lens and paste it in. It’s parsed on the device with no network call.
Who had what
Drag a name from the tray onto an item, or tap a name and then tap items. Split everything evenly covers the whole bill in one tap.
One link
Friends pick their name on the bill link and tap what they had. The bill page refreshes every 3 seconds, so everyone sees the same claims.
Tax and tip
Tax is a rate or an amount, and it falls only on taxed items. Tip is a percent or an amount, split by order or evenly.
Paying back
Each friend sees their amount on buttons for Venmo, Cash App, PayPal and Zelle. The Zelle button copies the handle to paste into a bank app.
Trips
A trip collects receipts in different currencies and converts them to one. It then lists the payments that settle everyone up.
Running tab
The home page keeps a running tab across your recent bills, along with saved groups. Both stay on your device.
How I built it
Two browsers played host and friend, and every total matched the hand-checked math.
- 01
First build
Scan, paste, claims, pay buttons and trips
Merged November 3, 2026
- 02
Host and friend
Two browser sessions in one Playwright run
Claims, live updates, pay links and settle-up
Left out A real Claude scan and live exchange rates
- 03
Its own host
One rewrite for every path
Old /split links redirect there
Checked Seven other hosts served the same pages as before
- 04
Audit fixes
Each scan logged before the model call
Why Scans sent together all got past the old limit
- 05
Settle-up copy
Four places promised the fewest payments
Now they say who pays whom
The audit came about a week after launch. A new claim now has to name an item and people that are on the bill, and new bills and trips are capped per visitor. On the bill screen only one save is in flight at a time, so two saves can’t land out of order.
The questions
Every screen answers a question about who owes what.
Who had what?
What does each person owe once tax and tip are in?
Do the shares add up to the bill?
Who pays whom after a whole trip?
How it works
Each browser does the math from one bill kept on the server.
- 01
Receipt
A photo, shrunk to 2,000 px on its long side
Or text pasted from Live Text
- 02
Scan route
Posts to the Anthropic Messages API
A Claude Haiku model by default
Reply capped at 2,500 tokens
Every field of the reply checked
Limits 3 scans per visitor every 30 minutes, and 200 a day across everyone
- 03
Supabase
Five tables behind row-level security
Reached only from server routes
- 04
Bill page
Shares computed in the browser
Refreshed every 3 seconds
Also reads ECB daily rates through Frankfurter, cached 12 hours
Pasted text goes to a parser on the device first. It handles rows printed on one line, and the layout where Live Text reads every name before every price. When the result looks off, Have Claude sort it sends the text to the model.
The model’s reply never reaches the browser as is. It has to parse as JSON, and each field is read on its own. At most 200 items are kept. The code lives inside this site’s repo, which is private.
The math
Shares round to whole cents and still add up to the bill.
Each person’s share
- totalitems + tax + fees − discounts + tip
Fees and discounts follow each person’s part of the item total. A tip split evenly is the tip divided by the number of people.
Rounding
- tax from a raterate × taxed items, rounded to the cent the way a register does
- final sharesfloored to whole cents, then the leftover cents go one at a time to the largest remainders
A $10.00 pizza split three ways with 7.25% tax and a 20% tip comes to $12.73. One person pays $4.25 and the other two pay $4.24.
Trips
- balancewhat a person is owed across the trip’s bills minus what they owe, in the trip’s home currency
- settle-upthe biggest debt pays the biggest credit, repeated until every balance is zero
Only unpaid shares count, and balances settle in whole cents.
New US bills start at California’s statewide 7.25%. The picker holds 24 more city and county rates from the CDTFA table effective October 1, 2026, and a tax amount printed on a scanned receipt replaces the rate.
Source for the California rates: CDTFA sales and use tax rates
What it found
The shares add up to the cent, and a trip can take one payment more than it needs.
The two charts below come from running S P L I T’s own split code, the same functions the bill and trip pages call.
What receipts got wrong
Receipt text shows up out of order.
Live Text reads names and prices as separate columns
Pasted text could close its own tag
A long receipt can run past the reply cap
A burst of scans can outrun the counter
Some currencies have no ECB daily rate
Venmo and Cash App only take dollars
Decisions
Nobody signs in, and a bill deletes itself.
No accounts
Starting a bill stores an edit key in that browser, and only that browser can edit the bill. Anyone with the link can claim items and mark themselves paid.
Bills expire
A bill goes 30 days after its last change, or 7 days after everyone has paid the payer back. An empty trip goes after 30 days.
Cleanup with no cron job
Expired bills are cleared when someone starts a new one, at most once an hour. Opening an expired link deletes that bill too.
Polling
The bill page asks the server for the bill every 3 seconds, and only while its tab is visible. Nothing holds a connection open.
No raw IPs
The limit log stores a SHA-256 hash of the visitor’s IP with the kind of request. Rows are deleted after a day.
Caps on what a link can write
A bill holds up to 200 items and 40 people. One visitor can start 30 bills and 10 trips an hour.
Kept out of search
Bill and trip pages are noindex and blocked in robots.txt.
Design
A name drags onto an item, and a tap does the same job.
Drag pins
Names drag from the tray with a mouse or a finger. Drag a pinned name to another item to move it, or back to the tray to take it off.
A short press on phones
A name already pinned to an item needs a 260 ms press before it lifts, so a swipe down the list still scrolls.
Scrolling mid-drag
Hold a name near the top or bottom edge and the page scrolls under it.
A tap path
Tap a name, then tap items. It does what the drag does.
A color for each person
Names take one of 12 colors, in the tray and on every item they’re pinned to.
Scoped styles
Every rule sits under .tabsplit, so none of it reaches the rest of the site.
Where it stands
Live, with tests on what comes in and none on the math.
- Tests passing
- 18
- Tests passing
- Tests on the split math
- 0
- Tests on the split math
- Currencies a bill can use
- 27
- Currencies a bill can use
- California tax rates built in
- 25
- California tax rates built in
| Item | Tests |
|---|---|
| Receipt text parser | 4 |
| The model’s scan reply | 8 |
| Claim requests | 6 |
| Shares and rounding | 0 |
| Trip settle-up | 0 |
What’s next
Tests on the money math come first, then an exact settle-up.
Next
Math tests
Cover the share math and the settle-up, starting with the examples on this page.
Shortest settle-up
Replace the greedy method with one that finds the shortest list of payments. The example trip above is the first test it has to pass.
A real scan
Run a real receipt through Claude and a trip on live ECB rates. The first test had neither.
Quarterly rates
Check the built-in California rates against the CDTFA table when each new quarter starts.
Known limits
Untested math
The share math and the trip settle-up have no tests. The examples on this page each come from a single run of the code.
Greedy settle-up
The list of payments is not always the shortest one. The method is greedy, and the example trip above takes 4 payments when 3 would do.
Tax rates by hand
CDTFA changes rates each quarter. The built-in list is dated October 1, 2026 and gets updated by hand.
One browser holds the key
The edit key lives in one browser’s storage, and there is no sign-in to get it back.
Face value
A receipt in a currency with no ECB rate counts at its printed number on a trip.
TL;DR
Built
A receipt scanner and bill link where friends tap what they had and tax and tip split to the cent.
Found
The sample bill’s five shares add up to its $133.66, and the example trip takes 4 payments where 3 would do.
By the numbers
- Sample bill, split to the cent
- $133.66
- Tests passing
- 18
- Tests on the split math
- 0
The catch
The split math has no tests. Each example on this page comes from a single run of the code.
Next
Write tests for the share math and the settle-up, starting with the examples on this page.