What a barcode tells you about your food
A can of black beans carries a rectangle of bars and twelve digits printed underneath. Point a phone at it and a brand, a size and sometimes a nutrition panel appear, which makes it look as though the bars held all of that. They hold none of it. The twelve digits are a name. Everything that appeared on the screen came out of a database that had already been told what that name refers to.
The distinction decides what a scan can be trusted for.
The number is a licensed identifier and nothing more
The digits under the bars are a Global Trade Item Number, issued through GS1, the body that runs the numbering system. GS1 calls a GTIN a product identifier that is "unique, global and verifiable within the GS1 system", and describes its digits as indicating which GS1 Member Organisation licensed the number, which company applied it to the item, the item number itself, and a check digit (GS1, What is a GS1 GTIN?).
The lengths have names. Twelve digits is a UPC, used mostly in North America; thirteen is an EAN, used mostly everywhere else; fourteen identifies a case rather than a package; eight is for items too small to hold the rest (GS1, on GTINs, barcodes, EANs and UPCs).
The leading block is the GS1 company prefix, four to twelve digits long, licensed to one company by a GS1 Member Organisation (GS1). The company fills in the rest, and it has to fill in a different value for every version of the product: GS1's rule is that each variation, each size and each color needs its own GTIN, and that a number once assigned means that one product and no other (GS1). The 15-ounce can and the 28-ounce can of the same tomatoes are two different numbers. That is why matching on a barcode gets the size right without being told, and matching on a product name does not.
The final digit is a check digit, calculated from the digits ahead of it and present to "verify that the identifier has been entered correctly" (GS1 US). It is arithmetic rather than a lookup, so it catches a typo before anything is searched for. When a hand-typed number comes back as not a barcode, that is usually the check digit disagreeing, not the product being unknown.
The digits do not say where the food came from
The leading digits are widely read as a country of origin. They are not one. GS1's own answer is that a barcode number starts with the prefix of the Member Organisation that allocated it, and that this prefix "does not indicate that the product was manufactured in a specific country or by a specific manufacturer; it may have been produced anywhere in the world" (GS1). A company can license its prefix in one country and pack food in three others.
Nor is there nutrition, an ingredient list, a date or a price in there. The retail symbol on a grocery package "encodes only the GTIN" (GS1 US). There is no room for more and no intention of making room: the design goal is a short number a register reads reliably and then looks up.
Price makes that concrete. Two identical jars on the same shelf, one rung up at full price and one on sale, carry the same digits; the price is held by the store's system and attached to the number for that week. The date is missing for a different reason. A best-by date is printed separately, in different ink on a different part of the package, because it is not the same for every unit sharing the GTIN. Anything that tells you a scanned item expires on a particular day either read that date off the package as text or estimated it from a category average, and what the printed date is worth once you have it is a separate question — see what date labels on food actually mean.
Symbols that carry more than a GTIN do exist. GS1 application identifiers let a barcode carry attributes such as a serial number, a batch number or an expiry date, and they are read from GS1-128, GS1 DataBar, GS1 DataMatrix and GS1 QR Code symbols rather than from a plain UPC (GS1). Those appear on cases, on healthcare packaging, and increasingly on retail packs: GS1 US calls the transition Sunrise 2027 and says a 2D code "can include information like batch and lot numbers, weight, price, and expiration date" (GS1 US). During the changeover a package may carry both symbols. The linear one is still the one at the register.
A database is what turns the number into a product
Open Food Facts is one of the databases behind consumer food apps. It is collaborative, free and open, built by volunteers, and on 6 September 2026 its front page offered a search across 4,733,197 products (Open Food Facts). A lookup is the barcode dropped into a URL, and the response says whether the product was found (Open Food Facts API).
USDA keeps one as well. The Branded Foods dataset inside FoodData Central is supplied by food industry data providers under a partnership whose members include GS1 US, the organization that issues the numbers in the first place (USDA FoodData Central).
Both deserve the caution Open Food Facts prints about itself: its data comes from volunteers, and there are "no assurances that the data is accurate, complete, or reliable" (Open Food Facts API). So a barcode lookup is an exact identifier attached to a draft description. Check the quantity and the unit against the package before the number goes into anything that will do arithmetic with it, because a wrong brand is obvious and a wrong net weight is not. The same reasoning covers any machine-supplied record (when an AI says it can't tell).
A barcode that returns nothing is information too. It means nobody has entered that product yet, not that the food is unusual.
One wrinkle explains a share of those misses. The same item can be written several ways: a twelve-digit UPC, the thirteen-digit form with a leading zero, and the fourteen-digit form with two, since a fourteen-digit code carries a GTIN-12, GTIN-13 or GTIN-14 in one fixed length (GS1 US). A lookup that asks only about the digits exactly as scanned will sometimes be told no about a product that is on file in a different form.
The food in the kitchen that has no useful barcode
Loose produce is numbered by a different system. PLU codes are four or five digits on a small sticker, assigned by the International Federation for Produce Standards; four-digit codes are conventionally grown, and a 9 in front of the same four digits marks organic. IFPS is blunt about how much the digits mean: "There is no intelligence built into the code" (IFPS). A PLU names a commodity at a size rather than a package, so it carries no weight and no brand, and it is not a substitute for a GTIN.
Anything weighed at a counter is a second gap. GS1 US calls these variable measure trade items — products "priced, ordered, or invoiced in quantities that can vary" — and uses the deli as its example, a wheel of cheese cut into packages of differing weight and sold by the pound (GS1 US). A GTIN identifies one product, and a package that weighs something different every time is not one product in that sense. The label the store prints has to carry that package's own weight and price, which a plain retail symbol cannot do, so the number on it belongs to the store. Scanning it against a public database returns nothing, and nothing is the correct answer.
Reading a scan for what it is
Three habits follow.
The digits are the whole payload, so typing them is the same input as scanning them. A camera that will not focus on a curved jar is not a dead end.
Different sizes are different numbers by design. Two entries in a pantry that look like the same product at different weights are usually both correct.
Loose, bulk and store-packed food will never come back from a lookup, and neither will anything from a farm stand. Naming it once by hand is the whole fix rather than a workaround.
Pantry Pro decodes the barcode on the device and then looks the number up, which is the division of labor the format was built for: reading the name is cheap and exact, and everything after that is a query somebody else already answered.
A barcode is an excellent name and a poor description. It was designed to be short, unambiguous and machine-readable, and it manages all three by holding almost nothing. What you want to know about the food is somewhere else, filed under that name by whoever bothered to write it down.
Sources
- GS1, What is a GS1 GTIN?
- GS1, What is the difference between a GTIN, a barcode, an EAN and a UPC?
- GS1, What is a GS1 Company Prefix?
- GS1, How many GS1 GTINs do I need for my products?
- GS1, Does the GS1 prefix show the country of origin?
- GS1, Why should I use the GS1 Application Identifiers in a barcode?
- GS1 US Help Center, Barcodes available in GS1 US Data Hub
- GS1 US Help Center, Check digit calculator
- GS1 US Help Center, Working with variable measure trade items
- GS1 US, The world of 2D barcodes
- International Federation for Produce Standards, PLU codes
- Open Food Facts
- Open Food Facts, API documentation
- USDA FoodData Central, About us
- Pantry Pro, User manual
More guides
- A freezer inventory you will actually keep
- A pantry staples list, and how long each keeps
- After a power outage, what to keep and what to throw out
- Cooking from what you have
- Dented cans, rust, and when a can is not safe
- First in, first out, at home
- How long food really keeps
- How to store fruits and vegetables so they last
- What is safe in leftovers, and for how long
- Planning meals around what expires
- Spending less on groceries without coupons
- What date labels on food actually mean
- What food waste costs a household
- What groceries cost per person
- When an AI says it can't tell
Keep track of it
Pantry Pro keeps a real inventory of the food in your house — what you have, where it is, and when it runs out — from a photograph of a receipt or a shelf, and tells you what you can cook from it tonight.