The Smidge food database
The Smidge database holds 3,467,777 packaged-food products, merged by barcode from Open Food Facts and USDA FoodData Central Branded Foods. This page says what is in it, how it is built, how much of each field is filled in, and where it is wrong. Every number below comes from a saved query.
What it is
The database is one SQLite file with a row per barcode: a name, a brand, calories and nutrients per 100 g, a serving and package size where known, categories, and a few fields that only Open Food Facts supplies. Rows with the same name and brand are also gathered into groups, so a search shows one product instead of dozens of repeats. The Foods page searches it, and the blog's data posts run saved queries against it.
| Item | Value |
|---|---|
| Products (rows, one per barcode) | 3,467,777 |
| Groups (one per name and brand) | 2,784,193 |
| Largest group | 1,214 entries |
| Built | 16 November 2026 |
| Open Food Facts changes applied through | 15 November 2026 |
| USDA Branded Foods release | 29 October 2026 |
The largest group is "Aceite de oliva virgen extra" with no brand. The database is a snapshot: a product added to either source after those dates is not in it. The file is used by Smidge and is not offered for download.
Sources and licenses
| Source | What Smidge takes from it | License as stated by the source |
|---|---|---|
| Open Food Facts | Names, brands, nutrients (from the label, or an estimate from the ingredient list), serving and package size, categories, scan counts, the Nutri-Score grade, the NOVA group, and the United States tag | Database under the Open Database License; individual contents under the Database Contents License; product images under Creative Commons Attribution ShareAlike (terms of use) |
| USDA FoodData Central, Branded Foods | Names, brands, nutrients, serving size and category text | Public domain and not copyrighted, published under CC0 1.0 Universal (FoodData Central) |
The USDA Branded Foods data is label data collected through a public-private partnership; its data documentation lists the Branded Foods data source as manufacturers, based on food label information (data documentation). The FoodData Central home page says the Branded Foods Product Database, provided by the Global Data Synchronization Network (GDSN), is updated monthly, and that it no longer receives new or updated food component information from Label Insight after 16 November 2023.
This page states the licenses of the sources as they publish them and gives no advice about reusing the combined file. The file holds no product images.
Food data from USDA FoodData Central (public domain) and Open Food Facts (Open Database License).
How it is built
The build reads the full Open Food Facts product dump and the newest USDA Branded Foods release, keeps each source as it last described every barcode, and then makes one product row per barcode. The build tooling can then apply Open Food Facts' daily change files and load a newer USDA release. These are the rules, as the build code has them.
Barcodes
A barcode has its leading zeros dropped and is kept as a number. A code with any character that is not a digit is discarded, and so is one with fewer than 4 or more than 14 digits. So a 12-digit UPC-A code and the same code written as a 13-digit EAN with a leading zero become one row. If two Open Food Facts codes collapse into one barcode, the more recent edit is kept. For USDA, only the newest label revision of a barcode is kept, and discontinued products are skipped.
Which source's nutrients win
USDA's values are used when they pass the checks below. If they do not, or USDA has no entry, Open Food Facts' label values are used. If the label gives no calories, Open Food Facts' own estimate from the ingredient list is used.
Open Food Facts label values are read in this order:
- Its per-100 g aggregate for the product as sold.
- If that has no calories, the preferred as-sold label set: manufacturer-entered before read off the packaging, then per 100 g before per serving. A per-serving set is converted only when the serving is 10 to 5,000 g or ml.
- If neither has calories, the flat per-100 g values that older Open Food Facts documents carry.
The checks reject a nutrient set when:
- it has no calories, or calories outside 0 to 950 per 100 g;
- protein, carbohydrates, fat, sugar or fiber is outside 0 to 100 g;
- protein, carbs and fat add up to more than 110 g;
- the calories look like kilojoules typed into the calories field;
- the calories are far below what the macros allow: under 0.45 × (4 × protein + 4 × carbs + 9 × fat), minus 20.
Two single values are dropped on their own, without rejecting the product: a sodium value outside 0 to 42,000 mg, and a saturated fat value outside 0 to 100 g or more than 0.5 g above the fat itself. A product with no valid nutrients, or no name, is left out of the file.
Each row records the decision in rule, and whose nutrients it carries in nutrient_source.
| Rule | What decided the row | Rows |
|---|---|---|
| off | Open Food Facts label values; no valid USDA entry | 3,003,421 |
| usda | USDA values passed the checks | 413,030 |
| off_estimate | Open Food Facts estimate from the ingredient list, because the label gave no calories | 27,058 |
| usda+off | USDA values, with gaps filled from Open Food Facts label values whose calories agree within the larger of 5 kcal or 10% | 18,826 |
| off:usda_invalid | A USDA entry failed the checks; Open Food Facts label values used | 5,298 |
| off_estimate:usda_invalid | A USDA entry failed the checks; Open Food Facts estimate used | 144 |
An estimate never fills a gap in label data, and a nutrient that is missing is filled from Open Food Facts only when both sources agree on calories. In total 27,202 rows carry the estimate (nutrient_source off_estimate). Of the 3,467,777 rows, 437,298 have a USDA entry, and 5,442 of those had a USDA entry that failed the checks.
Names, brands, serving and the rest
The name and the first listed brand come from Open Food Facts, with USDA's name, written in title case when it is all capitals, used where Open Food Facts has none (63,555 rows). Serving size comes from USDA first. Package size, scan count, Nutri-Score and NOVA come from Open Food Facts only. Open Food Facts scans are unique scans, which the search uses to rank popular products higher.
Nutrient columns hold amounts per 100 g, or per 100 ml for a product measured in milliliters. A serving or package size in milliliters is stored as if it were grams, and the file has no column saying which unit a product used.
Fields
The table shows how many groups, counting each group's shown row, and how many rows have a value. A zero counts as a value; a blank does not.
| Field | Meaning | Groups | Rows |
|---|---|---|---|
| kcal | Calories per 100 g | 100.0% | 100.0% |
| protein | Grams per 100 g | 98.9% | 98.9% |
| carbs | Carbohydrates, grams per 100 g | 98.8% | 98.8% |
| fat | Grams per 100 g | 98.7% | 98.7% |
| sat_fat | Saturated fat, grams per 100 g | 88.8% | 89.7% |
| sugar | Total sugars, grams per 100 g | 91.5% | 92.2% |
| fiber | Grams per 100 g | 53.5% | 51.6% |
| sodium_mg | Milligrams per 100 g; from sodium, else salt divided by 2.5 | 86.2% | 86.3% |
| serving_g | Serving size in grams | 50.0% | 46.1% |
| package_g | Package size in grams, Open Food Facts only | 31.4% | 29.8% |
| nutriscore | Open Food Facts' Nutri-Score grade, a to e | 39.4% | 39.1% |
| nova | Open Food Facts' NOVA group, 1 to 4 | 32.3% | 30.3% |
| categories | Up to three category tags, or USDA's category text (non-empty) | 48.8% | 48.0% |
| scans | Open Food Facts unique scans (above 0) | 40.4% | 38.6% |
Other columns are always filled: barcode, name, brand (an empty string when there is none), is_us, nutrient_source, name_source, rule and grp. The column fdc_id, the USDA identifier, is filled for the 437,298 rows with a USDA entry. A serving of 1 to 500 g, the range the shown-row rule below treats as believable, is listed on 49.5% of groups and 45.6% of rows.
The column is_us is 1 when Open Food Facts tags the product for the United States, or when its USDA entry has the United States as its market country. It marks 890,831 rows (25.7%) and 732,443 groups (26.3%). It is not a country: the file has no country column.
Groups and the shown row
One product often has many barcodes: package sizes, countries, repackagers and repeat entries. Rows with the same name and brand form a group. The name and brand are compared as lowercase letters and digits only, so "Coca-Cola" and "coca cola" are one name; a different spelling or a different brand text makes a separate group. The 3,467,777 rows make 2,784,193 groups.
| Entries in the group | Groups | Rows | Groups with a differing entry |
|---|---|---|---|
| 1 | 2,515,615 | 2,515,615 | 0 |
| 2 | 171,303 | 342,606 | 62,412 |
| 3 to 5 | 73,325 | 257,765 | 42,802 |
| 6 to 10 | 15,297 | 111,839 | 11,667 |
| 11 to 50 | 7,753 | 147,409 | 6,771 |
| 51 to 100 | 620 | 42,355 | 604 |
| over 100 | 280 | 50,188 | 278 |
In all, 268,578 groups hold more than one entry, and those groups contain 952,162 rows. Every row keeps its own values, and the file records, for each row, which row of its group is the shown one.
The shown row is chosen in steps:
- Each row gets a signature: calories rounded to the nearest 5, and protein, carbs and fat each rounded to the nearest 2 g, with a missing macro counted as its own value.
- The group's most common signature is picked. On a tie, a signature that includes a row with USDA nutrients wins.
- Within that signature, the row with USDA nutrients comes first, then a row with a serving of 1 to 500 g, then the row with the most Open Food Facts scans, then the lowest barcode.
A group's scan count is the sum over all its rows. That is what the Foods page ranks on, together with how many entries the group has.
When entries disagree
Entries for the same name and brand do not always agree. An entry counts as differing when its calories are further from the shown row's than the larger of 3 kcal or 5% of the larger of the two values. Of the 268,578 groups with more than one entry, 124,534 have at least one differing entry, and there are 286,651 differing entries across all groups.
| Name (no brand) | Entries | Differing | Lowest kcal | Highest kcal |
|---|---|---|---|---|
| Aceite de oliva virgen extra | 1,214 | 237 | 100 | 924 |
| Huile d'olive | 729 | 421 | 0 | 900 |
| Parmigiano Reggiano | 613 | 14 | 0 | 462 |
| Comté | 612 | 2 | 350 | 472 |
| Chocolat | 610 | 259 | 0 | 810 |
The file does not decide which entry is right. The shown row is the most common reading, and the group's calorie range is kept beside it.
Categories, NOVA and Nutri-Score
Categories are the last three English tags (those starting with en:) of an Open Food Facts product, joined with a vertical bar, most specific last. Where Open Food Facts has none, the USDA category text is used. Of all rows, 1,539,168 have Open Food Facts tags, 123,673 have USDA text and 1,804,936 have no category. The file also holds a statistics table for the 3,305 category tags that appear on at least 60 groups.
The Nutri-Score grade and the NOVA group are Open Food Facts' own. They are copied even when USDA's nutrients win, and a product that exists only in USDA has neither. Open Food Facts values of "unknown" and "not applicable" are stored as no grade.
| Grade | Rows | Groups |
|---|---|---|
| a | 196,725 | 159,188 |
| b | 153,360 | 122,625 |
| c | 285,588 | 237,337 |
| d | 344,967 | 275,548 |
| e | 375,793 | 302,700 |
| none | 2,111,344 | 1,686,795 |
| NOVA group | Rows | Groups |
|---|---|---|
| 1 | 125,702 | 106,414 |
| 2 | 45,492 | 32,410 |
| 3 | 203,733 | 176,213 |
| 4 | 676,658 | 582,979 |
| none | 2,416,192 | 1,886,177 |
What the file does not have
- A country. Only
is_us, described above. - Added sugars.
sugaris total sugars. - A salt column. Salt is stored as sodium, with salt divided by 2.5 when only salt is given.
- Polyols, alcohol, ingredients, additives, vitamins and minerals.
- A date for a product. The file has one build date, not a date per row.
- Prices.
A product that the sources list without valid nutrients or without a name is not in the file, and the file does not record how many were left out.
Known issues
These counts are of rows (barcodes) unless stated. They are not errors in every case: a count shows how many rows have a pattern, not how many are wrong.
| Pattern | Rows |
|---|---|
| Calories exactly 0 | 65,391 |
| Calories above 900 per 100 g (the checks allow up to 950) | 1,068 |
| Protein, carbs and fat adding up to more than 100 g per 100 g (the checks allow up to 110 g) | 10,832 |
| Sugar above carbohydrates by more than 0.5 g (not checked by the build) | 2,940 |
| Fiber above carbohydrates by more than 0.5 g (not checked by the build) | 45,172 |
| Serving size above 500 g | 12,251 |
| No brand | 813,416 |
| Nutrients estimated from the ingredient list | 27,202 |
| USDA nutrients on a row not tagged for the United States | 1,011 |
| Groups with at least one differing entry | 124,534 |
- The same product can sit in more than one group when its name or brand is spelled differently, because grouping ignores only case and punctuation.
- Product names in the two sources are in several languages, as the largest groups show.
- Products that Open Food Facts deleted are removed only by a full build, according to the build notes; the daily updates remove only products marked obsolete.
- The USDA Branded Foods data comes from manufacturer labels, and the Label Insight feed stopped on 16 November 2023 (see the sources section).
- The Open Food Facts data is written by contributors and can contain mistakes.
How the blog uses it
Each data post on the blog is built from a saved query: a SQL file that reads the database and writes a CSV, in a study folder next to the post. The post's method box names the build date and the source releases, shows the saved query, and links the CSV for download. The queries behind this page are saved the same way, one file per table above.
The study runner has a --check mode that reruns every saved query read-only, and compares each result byte for byte with the saved CSV and the database's SHA-256 with the record. It passes for this page's queries on this build, whose SHA-256 is ec976861b4c3b3d36088ef464b1e691d29b31227e73fbf222ae74179afe046bb. The database file is not published, so the check is run by Smidge.
Corrections
Found a wrong number on this page, or a product that looks wrong in the search? Write to support and say which page and which figure.
Last updated 17 November 2026