Wiki

How the Meal Builder Works

How meal nutrition totals are calculated from USDA food data, including macro/micro scaling, Atwater energy factors, and RDA percentages.

Verified against USDA FoodData Central on 15 Feb 2026 Updated 15 February 2026 4 min read
Open calculator
Translated article · View in English

概要

The Meal Builder lets you combine foods from a database of 142 USDA-verified items, set portion sizes, and see live nutritional totals: calories, macronutrients (protein, carbs, fat, fiber, sugar), and 25 micronutrients with percentage of daily value.

All food data comes from USDA FoodData Central. Nutrient values are stored per 100g and scaled linearly by portion weight.

仕組み

  1. Search and add foods — type a food name to search the USDA database. Select a food to add it to your meal with a default serving size.
  2. Adjust portions — use the slider or type a gram weight. Preset serving sizes (e.g. “1 medium”, “1 cup”) are available where the USDA provides them.
  3. View live totals — calories, macros, and micronutrient coverage update instantly as you add or adjust foods.

Nutrient scaling

All nutrients in the database are stored as values per 100g. To calculate the amount in a given portion:

nutrient_portion = nutrient_per_100g × portion_grams ÷ 100

Where

nutrient_per_100g= The nutrient amount per 100g from the USDA database
portion_grams= The weight of the portion in grams

Meal totals are the sum of each food’s scaled values.

Macro energy percentages

To show the protein/carbs/fat energy split, the calculator uses the Atwater general factors — the standard system for food energy labelling worldwide (EU Regulation 1169/2011, FDA nutrition labels):

total_energy = protein × 4 + carbs × 4 + fat × 9 (kcal)

Where

protein × 4= Protein provides 4 kcal per gram
carbs × 4= Carbohydrates provide 4 kcal per gram
fat × 9= Fat provides 9 kcal per gram

Each macro’s percentage is its energy contribution divided by the total. Note: the calorie total displayed comes directly from the USDA database (which may use food-specific Atwater factors), so the macro percentages may not reconstruct the exact calorie total — this is normal and matches how all consumer nutrition tools work.

Micronutrient coverage (% daily value)

percent_dv = (nutrient_amount ÷ reference_daily_value) × 100

Where

nutrient_amount= Total from the meal (summed across all foods)
reference_daily_value= Reference intake for adults 19–50 (see table below)

The reference daily values are a hybrid of EU NRV (Regulation 1169/2011), EFSA Dietary Reference Values, and NIH Recommended Dietary Allowances, chosen to reflect the most current science for adults 19–50:

NutrientDaily valueSource
Vitamin C80 mgEU NRV
Iron14 mgEU NRV
Calcium1000 mgNIH RDA
Vitamin D15 mcgEFSA AI
Zinc10 mgEU NRV
Folate400 mcgNIH RDA
Vitamin A800 mcgEU NRV
Potassium3500 mgEU NRV
Sodium2300 mgEU NRV / FDA DV

All 25 tracked micronutrients and their reference values are listed in the calculator’s source code with full attribution.

計算例

Chicken, rice & broccoli (150g + 200g + 100g)

1

Chicken breast, raw (150g)

120 × 150 ÷ 100 = 180.0 kcal, 22.5 × 1.5 = 33.75g protein

= 180.0 kcal

2

Brown rice, cooked (200g)

123 × 200 ÷ 100 = 246.0 kcal, 2.7 × 2.0 = 5.4g protein

= 246.0 kcal

3

Broccoli, raw (100g)

34 × 100 ÷ 100 = 34.0 kcal, 2.8 × 1.0 = 2.8g protein

= 34.0 kcal

Result

Total: 460 kcal, 42.0g protein, 57.8g carbs, 6.3g fat

Macro energy split (Atwater 4-4-9):

  • Protein: 42.0 × 4 = 167.8 kcal → 36.8%
  • Carbs: 57.8 × 4 = 231.2 kcal → 50.8%
  • Fat: 6.3 × 9 = 56.7 kcal → 12.4%

入力値の説明

  • Food search — searches the 142-food USDA database by name, with category emoji for quick recognition
  • Portion (grams) — adjustable via slider (10–500g) or direct number entry. Preset serving sizes where available.

出力値の説明

  • Total calories — the hero number. Sum of all foods’ scaled calorie values.
  • Macro donut chart — visual protein/carbs/fat energy percentage split
  • Macro grams — absolute grams of protein, carbs, fat, fiber, and sugar
  • Micronutrient bars — top 15 micronutrients by % daily value, sorted highest first. Green bar = percentage of reference daily intake.
  • Item breakdown — per-food calorie contribution (shown when 2+ foods are added)

前提条件と制限事項

  • Food data is from USDA FoodData Central — values are for generic foods, not branded products. Actual nutrient content varies by growing conditions, cooking method, and brand.
  • Raw vs cooked matters — the database includes both raw and cooked items. Make sure to select the version matching how you eat the food, as cooking changes nutrient density per gram.
  • Linear scaling — nutrient content is assumed to scale linearly with weight. This is standard practice but technically imprecise for very small or very large portions.
  • No alcohol — the Atwater factor for alcohol (7 kcal/g) is not included, as this is a food-focused tool.
  • RDA values are for adults 19–50 — requirements differ for children, pregnant/lactating women, and older adults.
  • 142 foods — the database covers common whole foods. Processed foods, branded products, and restaurant meals are not included.

検証

Test caseInputExpectedSource
Single food (100g)100g chicken breast (raw)120 kcal, 22.5g proteinUSDA FDC 171077
Scaled portion150g chicken breast (raw)180 kcal, 33.75g proteinManual: 120 × 1.5
Full meal150g chicken + 200g rice + 100g broccoli460 kcal, 42.0g proteinManual calculation
Empty mealNo foods added0 kcalIdentity
Macro % sumAny non-empty meal100%Atwater identity

Sources

nutrition meal-builder macros micronutrients calories usda