Wiki

How the Food Database Works

How the food nutrition database is built from USDA FoodData Central, with nutrient data per 100g, macro energy split, and micronutrient % daily values.

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

সারাংশ

The Food Database lets you search, browse, and compare nutritional data for 142 whole foods. Every value comes directly from USDA FoodData Central — the US government’s authoritative food composition database — and is expressed per 100g of raw weight.

You can search by name, filter by 14 food categories, sort by any macronutrient, and switch between grid and table views. Clicking a food reveals its full nutritional profile: macros, fibre, sugar, saturated fat, cholesterol, glycaemic index, and 25 micronutrients with percentage of daily value.

এটি কীভাবে কাজ করে

Data source

All food data is fetched programmatically from the USDA FoodData Central REST API using a curated list of 142 common whole foods. Each food’s nutrient values are stored per 100g — the standard base unit for food composition data and UK/EU nutrition labelling (EU Regulation 1169/2011).

The database covers 14 categories: fruit, vegetable, grain, legume, nut & seed, dairy, meat, poultry, fish & seafood, egg, oil & fat, herb & spice, beverage, and other.

Macro energy split

Each food card shows a colour-coded bar representing the protein/carbs/fat energy breakdown, calculated using the standard Atwater general factors:

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. The calorie value shown on the card comes directly from USDA (which may use food-specific Atwater factors), so the macro bar percentages and the displayed calories may not perfectly correspond — this is normal and matches standard practice.

Micronutrient % daily value

Expanding a food shows its top micronutrients as progress bars against the reference daily value:

percent_dv = (nutrient_per_100g ÷ reference_daily_value) × 100

Where

nutrient_per_100g= The amount of the micronutrient in 100g of the food
reference_daily_value= Reference intake for adults 19–50 (hybrid of EU NRV, EFSA, NIH)

The calculator tracks 25 micronutrients: vitamins A, B1–B12, C, D, E, K; minerals calcium, iron, zinc, magnesium, potassium, sodium, phosphorus, selenium, copper, manganese; omega-3, omega-6, and choline. Reference daily values are a hybrid of EU NRV (Regulation 1169/2011), NIH RDA, and UK SACN, chosen to reflect the most current science for adults 19–50.

Search and filter

  • Text search — case-insensitive partial match across food name and tags. Multiple words use AND logic (e.g. “brown rice” matches foods containing both “brown” and “rice”).
  • Category filter — click one or more category chips to filter. Categories are additive (OR logic).
  • Sort — sort by name, calories, protein, carbs, fat, or fibre. Numeric sorts are highest-first by default.

সমাধান করা উদাহরণ

Looking up chicken breast nutrition

1

Search for 'chicken breast'

The database returns: Chicken breast, raw, boneless, skinless

= 1 result found

2

Read the card

120 kcal per 100g. Protein: 22.5g, Carbs: 0g, Fat: 2.6g

= 120 kcal

3

Check macro energy split

Protein: 22.5 × 4 = 90.0 kcal (79.4%). Carbs: 0 × 4 = 0 kcal (0%). Fat: 2.6 × 9 = 23.4 kcal (20.6%).

= 79% protein, 0% carbs, 21% fat

Result

Chicken breast is 120 kcal/100g, almost 80% of its energy from protein

যাচাই

Test caseFoodExpected (USDA)Our valueMatch?
Chicken breastCalories120 kcal120 kcalYes
Chicken breastProtein22.5 g22.5 gYes
Broccoli, rawCalories34 kcal34 kcalYes
Broccoli, rawFibre2.6 g2.6 gYes
Brown rice, cookedCalories123 kcal123 kcalYes
Brown rice, cookedCarbs25.6 g25.6 gYes

All values are fetched directly from the USDA FoodData Central API, so they are inherently accurate against the source.

অনুমান এবং সীমাবদ্ধতা

  • USDA data only — all 142 foods are from USDA FoodData Central (SR Legacy and Foundation Foods). Branded products, restaurant meals, and UK-specific preparations are not included.
  • Per 100g raw weight — values are for the raw food unless the name specifies “cooked”. Cooking changes nutrient density per gram due to water loss or absorption.
  • No portion-size calculator — this page shows per-100g values only. Use the Meal Builder to build meals with custom portion sizes.
  • 142 foods — the database covers common whole foods. It is not exhaustive; for branded or niche foods, consult USDA FoodData Central directly.
  • Micronutrient completeness varies — some foods have null values for certain micronutrients where USDA data is unavailable. These are shown as 0% in the display.
  • RDA values are for adults 19–50 — requirements differ for children, pregnant/lactating women, and older adults.
  • Atwater approximation — the macro energy bar uses the general 4-4-9 factors. For high-fibre or high-alcohol foods, the bar may not perfectly match the USDA calorie value, which uses food-specific factors.

Sources

nutrition food-database usda macros micronutrients calories