Nutrition
Computed, Not Estimated: Recipe Calories Gram by Gram
Every recipe in a Cookrange plan has its calories and protein added up from its ingredients, gram by gram; none of it is a language model’s “about 520 kcal”. If a recipe calls for chicken breast, bulgur and a tablespoon of olive oil, its number is the sum of those three lines, divided by the number of servings and then multiplied by your portion factor.
This post covers how that sum is done, how it was tested, and, just as important, what it doesn’t promise.
Where does a recipe’s number come from?
Four steps, and no guessing in any of them.
- Ingredient data. Calories, protein, carbohydrate and fat per 100 g of each ingredient come from the US Department of Agriculture’s public-domain FoodData Central database (its SR Legacy and Foundation releases), matched to Turkish ingredient names. Fibre, sugar, sodium and some minerals are read from the same record where it has them.
- Measures to grams. A recipe can be written in kitchen measures, a cup, two tablespoons, one medium-sized something, but turning them into grams involves no assumptions. A volume needs that ingredient’s own density; a count needs its own unit weight. If either is missing, the recipe fails the calculation. Nothing quietly treats a millilitre as a gram.
- Raw and cooked. When an ingredient is stored raw but the recipe gives its cooked weight (cooked rice, say), a cooking factor converts it back to raw weight.
- The total. Each ingredient’s per-100 g values are multiplied by its grams in the recipe, summed, and divided by the servings. When your portion is scaled by a factor, calories, protein and every other value scale by exactly the same amount.
A recipe that fails the checks never reaches a plan
The result is checked before a recipe enters the library, and the plan only uses recipes that pass every check.
- Energy adds up. If the calories differ by more than 20% from what the macros imply (4 kcal per gram of protein and carbohydrate, 9 per gram of fat), it’s treated as a data error, a wrong unit or the wrong food record, and the recipe is rejected.
- A plausible serving. A main-meal serving has to land between 150 and 1,500 kcal, a snack between 50 and 600 kcal. Outside that, the recipe was almost certainly written wrong.
- Every ingredient accounted for. An ingredient whose allergen and diet information can’t be established stops the recipe. Unknown is never treated as safe.
- Missing values stay visible. If an ingredient lacks a value (fibre, for instance), the total isn’t presented as complete; the recipe records which nutrient is missing.
A model may draft a recipe, but never its numbers
Some recipes in the library were written by hand and others were drafted by a language model, and both go through the same gate. The template the model fills has no field for nutrition at all; if it volunteers a calorie figure anyway, that field is thrown away and the number is worked out from the ingredients like any other. Who wrote a recipe doesn’t change where its number comes from.
Building your weekly plan doesn’t call a language model either: the planner on the server picks recipes from the library and sizes the portions. Why that distinction matters is covered in more depth on how AI meal planning works.
How accurate is the calculation?
The engine was tested against an independent calculation on 29 October 2026. The USDA’s FNDDS dataset publishes the recipe behind each food (ingredients and gram weights) alongside the nutrient values the USDA computed for it. Of 50 recipes chosen from those whose every ingredient matched our records, and which involve no cooking losses, all 50 came within 5% (or 10 kcal and 1 g) of the USDA’s per-100 g values for calories, protein, carbohydrate and fat.
A second group of 50 recipes that lose water as they cook matched in 34 cases. Every miss was low on all four values by the same ratio: the mark of evaporated water. Water has no calories, so a serving’s total isn’t affected, but 100 g of the cooked dish is denser than the raw ingredients suggest. That’s why every cooked recipe now carries a factor for its finished weight.
That test measures the arithmetic. It doesn’t measure the food on your plate, which is a different question.
What the calculation doesn’t guarantee
- Ingredient values are averages. They’re reference values measured on food sold in the US. Your tomatoes, cheese or bread can differ by variety, brand and ripeness.
- The recipe’s amounts aren’t your plate. If you added an extra glug of oil or filled the ladle, the number doesn’t know.
- All of the oil counts as eaten. What stays in the pan isn’t subtracted, so the number may sit slightly high.
- Nutrient losses in cooking aren’t modelled. The retention factors the USDA applies in its own recipe calculations, which matter mostly for vitamins, aren’t applied here.
- It isn’t an allergen guarantee. The allergen check is a separate step; it can’t know about cross-contamination and isn’t a medical guarantee. How allergen filtering works has its own page.
- Photo estimates are a different thing. A meal added to your log from a photo carries a model’s estimate and should be read as one; where photo estimates go wrong has its own page.
Computed from ingredients versus estimated by a model
| Computed from ingredients | Estimated by a model | |
|---|---|---|
| Where the number comes from | Ingredient data and weights | The model’s generated text |
| The same recipe twice | The same number | Can come out different |
| Where errors come from | Ingredient averages, your portion | Those, plus the model itself |
| Can it be traced back | Each ingredient’s share is computed separately | Usually not |
Frequently asked questions
Does a packaged product I log by barcode go through this calculation? No. A product logged by barcode takes its values from its Open Food Facts record. The ingredient calculation applies to the recipes in the plan’s library.
If my portion gets bigger, does the protein go up too? Yes. The portion factor applies to every value in the recipe equally: a 1.2x portion is 1.2x the calories and 1.2x the protein.
Why US data rather than data from Türkiye? The data used is in the public domain, and it allowed the engine to be tested independently against recipe calculations published by the same agency. The cost is that a product sold in Türkiye can differ from it, which is exactly why the first caveat above is there.
Where to go from here
How the plan builds a week from these recipes is on the nutrition planning page, and the daily target those recipes fill is explained in the daily range post. Cookrange is currently at v0.9.6 internal alpha and isn’t in the app stores yet; if you’d like early access, join the waitlist.
This post is part of a short “why it’s different” series. The others: why a range instead of one number, how the plan follows your kitchen and what happens after an off-plan meal.