Methodology

By Eric Hale ยท checked November 2026

This page documents what NutrientLabel does, in the order it does it, so you can judge whether the output fits your product. It is a description of the software, not legal advice.

1. Data sources

Source links: USDA FoodData Central and 21 CFR 101.9 on eCFR. Every build also writes a machine-readable data manifest with the source URLs, SHA-256 hashes, release dates and missing-field counts.

2. From recipe to nutrients

  1. Ingredients and weights. Each ingredient is matched to a USDA record; you enter the amount in grams or a listed household measure.
  2. Batch totals. Nutrient values are summed for the batch, then divided by the number of servings you declare.
  3. Per-serving values. Calories and macronutrients are kept at full precision until the rounding step; they are not rounded twice.
  4. Added sugars and allergens. USDA does not publish added-sugar values for these datasets, so you mark each added-sugar ingredient and its total sugars are counted as added sugars. Major-allergen flags come from the ingredient names you enter.

3. FDA rounding and %DV

Rounding follows 21 CFR § 101.9(c): the rule for each nutrient depends on the amount present. For example, calories round to the nearest 5-calorie increment above 50, fat rounds to the nearest 0.5 g below 5 g and to the nearest gram above, and sodium rounds to the nearest 5 mg above 5 mg. %DV is calculated from the rounded amount and the applicable Daily Value, then rounded to the nearest whole percent.

The tool applies the current (post-2016) panel nutrients: added sugars, vitamin D, calcium, iron and potassium. It does not reproduce the pre-2016 sample panel that some state cottage food handouts still show.

4. Serving size and format

5. Scope of the tool

6. How the output is tested

The label engine is checked against 3,452 cross-implementation cases (Python and JavaScript produce the same values and geometry) plus 181 Python unit tests covering rounding boundaries, %DV, small-package formats and PDF rendering. The validation page explains the scope and the limits.

7. Version and changes

This page is reviewed when the nutrient data, rounding rules or label formats change. Last review: November 2026. If you find a discrepancy, email support@nutrientlabel.app with the recipe and the panel you expected; we will investigate and correct it.

Related