Johan Alphonso Braga
WorkProjectsReadingStackCraftDesignStatusResume

Utilities

Ask anything

Elsewhere

GitHub

All projects

Tools / 2026 / Live in the browser

Batchwise

Make any recipe bigger, smaller or fit the pan you have. Paste the ingredients, say how many it should feed or which pan you are using, and get amounts you can actually measure, in cups and spoons or grams. Scoop, a measuring cup, helps along the way.

Batchwise

01

The problem

Scaling a recipe sounds like multiplying by a number, and in a kitchen it goes wrong in known ways. The maths gives amounts nobody can measure: 2 cups of flour times 1.83 is 3.66 cups. A cup is volume, not weight, so going to grams needs a number per ingredient: King Arthur Baking lists a cup of flour at 120 g and a cup of sugar at 198 g. Cups even differ by country, 236.6 ml in the US and 250 ml in the UK, Canada, New Zealand and Australia, where a tablespoon is also 20 ml. A different pan needs a different amount (an 8 inch round recipe needs about 1.27 times everything in a 9 inch round), and eggs do not divide.

02

How I approached it

A parser reads ingredient lines the way recipes write them: fractions, mixed numbers, fraction characters, decimal commas, ranges, US and metric units, and countable things like cloves, cans and sticks of butter. A bracket that restates the amount, as in 1 cup (2 sticks) butter, is dropped once scaled, while a can size is kept. Volumes are held in millilitres for the chosen country's cup and spoon sizes, then written back in measures people own: teaspoons down to an eighth, tablespoons with a teaspoon remainder, and cup fractions with any leftover as whole tablespoons, so 3.375 cups reads 3 1/3 cups + 1 tbsp. Grams come from King Arthur Baking's chart for about 30 ingredients; anything not on it stays in ml rather than taking a guess, and kosher salt is left out because brands differ by nearly double. Pan swaps scale by floor area so the batter keeps its depth. Part of an egg becomes a beaten-egg measure in tablespoons and grams. The engine is a DOM-free UMD module shared by the page and node:test, and share links carry the recipe in the URL fragment.

03

The outcome

People, times and pan modes; as written, cups and spoons, or grams; a tick-off list for while you cook, plain-text copy, share link and print layout. A 48 cookie recipe made for 18 reads 3/4 cup + 1 tbsp flour (about 100 g), and 3/4 of an egg becomes 2 tbsp of beaten egg. 9 tests cover parsing, spoon and cup output, Australian tablespoons, the gram chart, weight to cups, eggs, cans and sticks, pan areas against America's Test Kitchen's table, and share links. Checked headless in Chrome at 375 px and desktop width with no console errors.

04

The mascot

Scoop is a measuring cup drawn in inline SVG. Scoop sleeps until a recipe is pasted, then follows the pointer or the field being typed in, and the batter inside rises or falls with the size you pick. A tap gives a tip for the current step. Scoop counts the ingredients it read, warns about a very big or tiny batch, explains how to use part of an egg, says how big the cups are when you change country, and throws sprinkles when every line is ticked off. Five quick taps tip Scoop over. Everything Scoop says goes through an aria-live region, Scoop can be tucked away, and nothing moves under reduced motion.

05

What I learned

Multiplying was the easy part. Nearly all the work went into writing the answer back in the cups and spoons people own, and in knowing when not to convert, like an ingredient with no known weight.

Also shipped the same day: Four camera games got real fixes: Eye Aim Trainer's gaze mode now moves the crosshair (WebGazer 2 answers asynchronously), Gesture Pong stops fast balls passing through paddles, Pose Beat Blaster scores on the press instead of while held, and Cam Chaos Booth gets a self-timer and a mirrored preview. See the commits ↗

batchwise.johanthegoat.xyz Open in a new tab ↗
Next projectChoreShare →