Can a barcode tell you the expiration date?

Sometimes — but usually not. The striped barcode on a box of cereal or a bottle of shampoo is a product number and nothing else. Scanning it tells you what the product is, not when it expires.

A different family of codes can carry more. GS1, the organisation that runs the barcode system used in shops worldwide, defines “Application Identifiers” that let a code hold extra data such as a batch number, a best-before date or an expiration date (GS1). You will mostly find those on medicine packs and on some fresh food, not on the average grocery item.

What information is stored in a barcode?

It depends on the type of barcode. Here is what you are likely to see on packaging, and whether it can hold a date:

Barcode typeWhere you see itContains expiry?
UPC-A (12 digits, lines)Retail products in the US and CanadaNo — product number only
EAN-13 (13 digits, lines)Retail products in most other countriesNo — product number only
GS1-128 (long line barcode with numbers in brackets)Cartons, pallets, some fresh and weighed foodCan — if it includes (15) or (17)
GS1 DataMatrix (small square of dots)Medicine packs, medical devicesOften — required for medicines subject to EU safety-feature rules
QR code with GS1 Digital LinkIncreasingly on food and consumer goodsSometimes
Ordinary QR codeMarketing, links to a websiteNo — usually just a web address

UPC and EAN barcodes encode a GTIN, the Global Trade Item Number that identifies the product (GS1). Every carton of the same milk from the same brand has the same UPC or EAN, whatever its date. GS1 describes both QR codes (with GS1 Digital Link) and GS1 DataMatrix as able to store the GTIN “as well as information such as an expiry date or a serial number” (GS1).

How to check an expiration date from a barcode

1. Identify the barcode type

Look at the shape. A row of vertical lines with 12 or 13 digits underneath is almost always a UPC or EAN — skip straight to step 4. A small square made of dots (DataMatrix), a QR code, or a long line barcode with numbers in brackets underneath, like (01) and (17), is worth scanning.

2. Scan it and look for (17) or (15)

A barcode scanner or GS1-capable reader can show the data encoded in the code. Each piece of data starts with a short Application Identifier:

  • (01) — the GTIN, the product number (14 digits)
  • (10) — the batch or lot number
  • (15) — the best before date
  • (17) — the expiration date (“use by” or “expiry”)

These definitions come from GS1's official Application Identifier list (01, 10, 15, 17). A scan might look like this:

(01)09506000134352(17)271231(10)AB12

Some apps drop the brackets and show one long run of digits instead: 01095060001343521727123110AB12. It is the same data. The (01) is always followed by exactly 14 digits and (17) by exactly 6, which is how you can split it by eye.

3. Read the date (YYMMDD)

Dates in GS1 codes are written as six digits: year, month, day. In the example above, 17 followed by 271231 means expires 31 December 2027. If the last two digits are 00, no day was given and the date means the end of that month. For regulated healthcare products, GS1 no longer allows 00 as the day value from January 1, 2025.

For medicines subject to the EU safety-feature rules, the 2D DataMatrix carries the product code, serial number, batch number and expiry date as part of the unique identifier, under the Falsified Medicines Directive's rules that apply since 9 February 2019 (European Commission, Delegated Regulation (EU) 2016/161). That is why scanning a medicine box so often works. If you keep a home cabinet, our medicine expiry tracker page covers keeping track of those dates.

4. If it's a regular UPC or EAN, check the packaging

If the scan shows only 12 or 13 digits, there is no date in the code, and no app can pull one out of it. Apps that “look up” a UPC can find the product's name and brand in a database, but that database has no idea when your carton expires. Look for the date printed on the pack instead (see below).

Why most barcodes don't show the expiration date

UPC and EAN were designed for the checkout: identify the product, find its price. Every unit of the same product carries the same code, printed once onto the packaging design. A date changes with every production run, so it is printed or stamped separately on the production line.

That is slowly changing. GS1 US describes “Sunrise 2027” as a move in retail from 1D UPC barcodes to 2D barcodes such as QR codes, aiming for shop scanners that can read 2D codes by 2027 (GS1 US). Its guidance encourages brands to add data such as expiration dates to those codes over time. For now, on most shelves, the old barcode is still the only one.

Where else to find the expiration date on packaging

If the barcode can't help, the date is somewhere on the pack. Common places:

  • Lids and caps — jars, bottles, yogurt pots, tins (the top or the underside).
  • The bottom — cans, cartons, trays and tubs.
  • The crimp — the flat sealed end of tubes like toothpaste, creams and ointments, often embossed rather than printed.
  • Near the batch code — the date is usually printed right next to a “LOT” or “L” number. The lot number is not the date.
  • Box flaps and blister edges — medicine boxes usually print it on an end flap and often on the foil too.

Look for these labels in front of the date:

  • EXP — expiry date, common on medicine and cosmetics
  • Use by — the last day to use the product
  • BB, BBE, Best before or Best if used by — a quality date
  • Sell by — a date for the shop, not for you

Cosmetics may show an open-jar symbol with “12M” or similar instead of a date. That is the period after opening — see our cosmetics expiration tracker page for how it works.

An easier way to keep track of expiration dates

Reading the date once is the easy part. Remembering it three months later is harder. Xpiry is an expiry date tracker for Android that handles the remembering: scan the barcode to add the product fast, type or pick the printed date once, and Xpiry reminds you before it expires. It does not read the date from the barcode — no app can for a standard UPC or EAN — but it saves you typing everything else.

Want an easier way to keep track? Xpiry lets you scan products, save their expiration dates and get reminded before they expire.

Get Xpiry on Google Play →

It works for a fridge and pantry as well as for shop and pharmacy stock.

FAQ

Can you scan a barcode to find an expiration date?

Only if the code contains one. A GS1 DataMatrix, GS1 QR code or GS1-128 barcode can include an expiration date after the identifier (17). A standard UPC or EAN barcode can't — it only holds the product number.

Does every barcode contain an expiration date?

No. Most barcodes on everyday products don't. Expiration dates appear mainly in 2D codes on medicine and in some codes on fresh food and cartons.

Can UPC barcodes show expiration dates?

No. A UPC-A barcode holds a 12-digit product number and nothing else. Any app that shows a date after scanning a UPC got it from somewhere else, not from the barcode.

What does (17) mean on a barcode?

(17) is the GS1 Application Identifier for an expiration date. The six digits after it are the date as YYMMDD — (17)271231 means 31 December 2027.

How do I keep track of expiration dates at home?

Write the date down once, somewhere that will remind you. A list on the fridge works for a few items; for more, an app like Xpiry keeps the list sorted by date and sends a reminder before each one expires.

Sources