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
- Public Health England (2016) Government Dietary Recommendations
- Safety upper limits borrowed from US National Academies Tolerable Upper Intake Levels (the UK has no complete set)
- WHO/FAO/UNU (2007) Protein and amino acid requirements in human nutrition, WHO Technical Report Series 935
- Vitamin A is expressed in retinol equivalents by PHE and in retinol activity equivalents by USDA food data; plant sources of vitamin A may be slightly overestimated against the UK target.
- Free sugars (limit 5% of energy) are not assessed because food databases do not separate free from intrinsic sugars.
- Children under 5 are advised to take vitamin A, C and D supplements; women who could become pregnant are advised to take 400 µg folic acid daily.
US Dietary Reference Intakes (National Academies)
- National Academies (2019) Dietary Reference Intakes summary tables, Appendix J of DRIs for Sodium and Potassium
- Dietary Guidelines for Americans 2020-2025, estimated calorie needs (via MSD Manual)
- WHO/FAO/UNU (2007) Protein and amino acid requirements in human nutrition, WHO Technical Report Series 935
- Upper limits for magnesium, niacin, folate and vitamin E apply to supplements and fortificants only, so they are not applied to food.
- The vitamin A upper limit applies to preformed vitamin A (retinol), not to carotenes from plants.
- Adults over 50 are advised to get most vitamin B12 from fortified foods or supplements.
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
- US food data, UK shops. Fortification differs between countries (for example US milk usually has added vitamin D; UK milk doesn't), and brands differ. Fortified products should be checked against their labels.
- Iodine and some other nutrients are missing from most USDA records, so they are listed as "not assessed" rather than guessed.
- Absorption isn't modelled yet. Iron from plants is absorbed less well than iron from meat, ALA omega-3 converts poorly to EPA and DHA, and phytates reduce zinc absorption. These are planned refinements.
- Amino acid targets use WHO adult requirements per kg of body weight and are applied to adults only.
- Reference values are for healthy populations. If you have a medical condition, are pregnant, or are planning food for a child, check with a doctor, midwife or registered dietitian.