Gallery
Nutri-Score by food group
How many US packaged products in each food group Open Food Facts grades D or E on Nutri-Score, from Chapter 4's read of the Open Food Facts product file.
Nine in ten sweets and biscuits grade D or E; fewer than one in twenty vegetables do
| Sweets | 92.8% |
|---|---|
| Biscuits and cakes | 92.4% |
| Processed meat | 88.6% |
| Cheese | 84.4% |
| Pizza pies and quiches | 78.0% |
| Sweetened beverages | 76.2% |
| Appetizers | 75.8% |
| Sandwiches | 61.2% |
| Dressings and sauces | 58.4% |
| Breakfast cereals | 57.9% |
| Plant based milk substitutes | 47.3% |
| Meat | 45.2% |
| One dish meals | 32.7% |
| Unsweetened beverages | 31.9% |
| Cereals | 31.3% |
| Fats | 28.2% |
| Bread | 25.4% |
| Artificially sweetened beverages | 23.2% |
| Milk and yogurt | 19.9% |
| Nuts | 19.2% |
| Fish and seafood | 17.6% |
| Fruits | 7.5% |
| Legumes | 5.0% |
| Eggs | 4.6% |
| Vegetables | 4.1% |
Nutri-Score grades a product from A (best) to E from its label's nutrient table, weighing sugar, salt, saturated fat and energy against fibre, protein and fruit or vegetable content. Across the 384,276 US products in Open Food Facts that have a grade, 56% score D or E. By food group the share runs from 92.8% for sweets and 92.4% for biscuits and cakes down to 4.1% for vegetables. Processed meat (88.6%) sits far above other meat (45.2%). The grade is computed by Open Food Facts; it is not printed on US packs. Only 39% of US products have one, and products enter the database when volunteers or brands add them, so the shares describe the database, not what Americans buy.
Grade shares per food group, with the D-or-E share as a window sumchapters/04-food-supply/pipeline/20_model.sqlShow SQL
CREATE OR REPLACE TABLE nutriscore_by_category AS
WITH c AS (
SELECT category, nutriscore_grade AS grade, count(*) AS n
FROM products WHERE category IS NOT NULL AND nutriscore_grade IS NOT NULL
GROUP BY ALL)
SELECT category, grade, n,
n / sum(n) OVER (PARTITION BY category) AS share,
sum(n) OVER (PARTITION BY category) AS n_category
FROM c;
-- 90_export.sql
SELECT category, grade, n, round(share, 4) AS share, n_category,
round(sum(share) FILTER (grade IN ('D', 'E')) OVER (PARTITION BY category), 4) AS share_de_category
FROM nutriscore_by_category ORDER BY share_de_category DESC, category, grade;125 rows: 25 food groups x 5 gradesRuns at build time in DuckDB 2.0; shown for reading.Open file
The FILTER clause inside a window function adds up only the D and E rows of each group, so the share sits on every row without a self-join. Chapter 4 draws all five grades per group as stacked bars; this version keeps only the D-or-E share for a quick ranking.
From Chapter 4: What packaged-food labels let us compare, which has the pipeline, the checks and the full grade breakdown. Data: public/data/food-supply/nutriscore_by_category.json.