← All guides

What a barcode tells you about your food

By The Pantry Pro team · 6 September 2026 · Updated 8 September 2026 · 8 min read

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 on the screen came out of a database that had already been told what that name refers to, and 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 organization licensed the number, which company applied it to the item, the item number itself, and a check digit (GS1).

The lengths have names. Twelve digits is a UPC, used mostly in North America; thirteen is an EAN, used mostly everywhere else; fourteen is for cases and outer packaging (GS1).

The leading block is the GS1 company prefix, four to twelve digits long, licensed to one company (GS1). The company fills in the rest, and GS1's rule is that each variation, each size and each color needs its own GTIN (GS1). The 15-ounce can and the 28-ounce can of the same tomatoes are two different numbers, which 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 ones ahead of it and present to "verify that the identifier has been entered correctly" (GS1 US). It is arithmetic rather than a lookup, so most typos are caught before anything is searched for.

That division of labor shows up in a kitchen. In Pantry Pro the camera decodes the barcode on the device, and what comes back is a product: a name, a brand, a package size where the database carries one, and the product's own photograph where Open Food Facts holds one. None of that has looked at the can in your hand, so what you do next is where the real record is made. Say How many you have and Where it is going, then Add to pantry; the unit and any printed date go on the row afterwards, the date in Expires, which is what puts the row under Use these soon when it comes due (planning meals around what expires).

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 GS1 member organization 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). Price makes that concrete. Two identical jars, one rung up at full price and one on sale, carry the same digits; the price lives in the store's system, attached to the number for that week. The date is absent for a different reason: a best-by date is printed separately, in different ink, 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.

A database is what turns the number into a product

Open Food Facts is one of the databases behind consumer food apps: 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 carries a status that says whether the product was found (API tutorial). USDA keeps one as well: the Branded Foods dataset inside FoodData Central comes from industry data providers under a partnership whose members include GS1 US, the organization that issues the numbers in the first place (USDA).

The order matters more than it looks. Pantry Pro checks your own items first, then USDA FoodData Central and Open Food Facts. Your own list goes first because it is the only one that knows what this household buys and what it calls things. When no database recognizes a number, you name the product once by hand and the barcode is stored on that item, so the next scan of the same package is an exact local hit rather than another lookup.

Both public databases 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" (API docs). A lookup is an exact identifier attached to a draft description. Check the quantity and the unit against the package before the number goes anywhere arithmetic happens: a wrong brand is obvious, a wrong net weight is not — the same reasoning that applies to any machine-supplied record.

A number that comes back with nothing attached is usually a gap in coverage rather than a strange food, and some of those misses are only formatting. The same item can be written as a twelve-digit UPC or padded with leading zeros to thirteen or fourteen, since a fourteen-digit code carries a GTIN-12, GTIN-13 or GTIN-14 in one fixed length (GS1 US). A lookup asking only about the digits as scanned is sometimes told no about a product on file in another form.

Some symbols do carry more than a name

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 turn up on cases 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). The linear symbol is still the one at the register, and still the one on most of the food in a home kitchen.

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 digits means conventionally grown, and a 9 in front of the same four marks organic. IFPS is blunt about how much they mean: "There is no intelligence built into the code" (IFPS). A PLU names a commodity at a size, not a package: no weight, no brand.

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 counter as its example (GS1 US). That page defines the category; the consequence in a kitchen is that the label the store prints carries that package's own weight and price, and the number under it is the store's own rather than a GTIN a manufacturer licensed, so a public product database has no particular reason to hold it.

Reading a scan for what it is

Two habits follow.

The digits are the whole payload, so typing them is the same input as scanning them. Pantry Pro puts a box under the camera — "…or type the number under the barcode" — and a Look up button beside it, which is the answer to a curved jar or a frosted freezer bag. Neither route spends the photo-scan allowance: barcode scanning is unlimited on every plan and no model is involved, unlike reading a receipt or a shelf photo, which are capped.

Coverage runs out at the edge of the packaged grocery aisle. Loose, bulk and store-packed food, and anything from a farm stand, is the least likely to come back from a public lookup, because these databases are built around goods a manufacturer numbered. Naming one by hand is the whole fix rather than a workaround, and the name sticks to the item.

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.

Scan your first pantry item

Opens Pantry Pro, which is free to start. It asks you to sign in, or to start a pantry if you do not have one yet.

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
  • Open Food Facts, API tutorial
  • USDA FoodData Central, About us

More guides

  • What date labels on food actually mean
  • When an AI says it can't tell
  • All guides

Home All guides Manual Privacy Terms