Methods and sources

How the nutrient planner works, where its numbers come from, and what it can't tell you.

Food composition data

Nutrient values come from USDA FoodData Central (public domain): the SR Legacy dataset, with newer Foundation Foods analyses used where a food has been matched to one. A curated list of about 55 cheap, common, UK-available foods is matched to USDA records; the list and the match report live in the repository's data/ folder so anyone can check them.

Current snapshot: built 2026-11-08, 52 foods. The snapshot is stored in the repository so the site keeps working even if the USDA servers change, and is refreshed every three months.

Recommended intakes

UK government dietary recommendations

US Dietary Reference Intakes (National Academies)

EU (EFSA) values are planned and will be added once they have been transcribed and checked against EFSA's published reference values.

How the planner chooses foods

The planner solves a mixed-integer programme (with the HiGHS solver, running in your browser). It chooses at most your chosen number of ingredients and an amount of each, in practical steps (10 g, half an egg, a slice of bread), to minimise the total relative shortfall across all minimum targets, so being 20% short of iron counts the same as being 20% short of protein. Upper limits (salt, saturated fat, tolerable upper intake levels) and your calorie range are never exceeded. Further options are found by forbidding most of the ingredients of earlier options.

Limitations