How the decoder reads a label
Packaging mixes the date with everything else: lot numbers, plant codes, packing times, weights. The decoder looks at every number that could be a date, then scores each one the way FreshScan does on your phone:
- Words next to the date decide its type.
BEST BY,BBandBEST BEFOREmake a best-by date;USE BYa use-by date;SELL BYandDISPLAY UNTILa sell-by date;EXPan expiration date. A keyword on the line just above or below counts too. - Packed-on and manufacturing dates lose. A date next to
PACKED ON,PKD,MFGorPRODis scored down, so the expiry date wins. Numbers afterLOT,UPCorNET WTare scored down so far that they drop out whenever the label has a real date. - Plausible food dates score higher. A date between today and about two years out is typical. Dates far in the past or many years ahead are doubted.
- It asks when it sees two readings. Two different dates, or a full numeric date that reads two ways, are shown as choices. A short date with no year is read in the order you pick and marked “Year not printed”, so check it.
Formats it understands
| Printed | Read as | Notes |
|---|---|---|
OCT 04 2026 | October 4, 2026 | Month names and abbreviations, including SEPT and some European ones (OKT, DEZ, MAI) |
04OCT26 | October 4, 2026 | Day first, no spaces, two-digit year |
10/04/26 | October 4 or April 10 | Depends on the order you pick (MM/DD or DD/MM); both are shown if both are plausible |
2026-10-04 | October 4, 2026 | Year-first dates are never ambiguous |
10/2026 | October 31, 2026 | Month and year only: read as the end of the month |
EXP 10 2026 | October 31, 2026 | Month and year with a space: only next to a date word like EXP, BB or BEST BEFORE |
2026/10 | October 31, 2026 | Year first, with -, / or . |
BB 10/26 | October 31, 2026 | Two numbers need a date word (BEST BEFORE 10 26 works too). USE BY or SELL BY 10/26 is also offered as October 26 when that's within 90 days |
OCT 04 | Next October 4 | No year printed: the next sensible year, flagged |
More on each format in how to read expiration dates, and on the 10/04 problem in month or day first?
What each kind of date means
Only infant formula is required by federal rules to carry a date. Everything else is dated voluntarily by the manufacturer, which is why the wording varies so much. USDA says best-by, sell-by and freeze-by dates are not safety dates. California's 2024 labeling law goes further and reserves “USE by” for dates about safety. The full comparison is in sell by vs use by vs best by.
What it can't do
It reads text you type; it can't see the package. Julian pack codes like the three-digit number on egg cartons aren't calendar dates, so they're left alone here: use the Julian date converter. And it can't tell you how long a food keeps once opened; for that, try the food expiration calculator.
Questions people ask
Is this the same logic the FreshScan app uses?
Yes. The decoder is a line-by-line port of the date parser inside FreshScan. It is tested against the app's own code on 6,000 label variations, and both must give the same date, date type, confidence and flags. The app adds the camera: it reads the text from the package with Apple's on-device text recognition, then runs the same rules.
Why does it ask me to choose between two dates?
Some labels print more than one date, such as a sell-by and a use-by date, or a date like 03/04/27 that means March 4 in the US and April 3 in most other countries. A short sell-by or use-by date like 10/26 can also mean October 26 or the end of October 2026. When both are plausible the decoder shows both and lets you pick, instead of guessing. The likeliest date is listed first; when two are equally likely, the use-by or expiration date comes first because it's usually the one to act on.
What does a two-number date like 10/26 mean?
On its own it could be October 26 or October 2026, so the decoder doesn't guess; it asks what's printed next to it. With BEST BY, BB or EXP it reads October 2026, the end of the month. With USE BY or SELL BY it also offers October 26 when that's within 90 days, and you pick. Spaced versions like BEST BEFORE 10 26 or EXP 04 2027 are read the same way, but only next to one of those words.
What if the label has no year?
Dates like SEP 17 are placed on the most recent SEP 17 if it was 45 days ago or less, otherwise on the next one. So DEC 20 typed in early January means the December just gone, and SEP 17 typed in December means next September. The result is marked 'Year not printed' so you can check it.
Does the decoder tell me whether food is safe to eat?
No. It reads the date the manufacturer printed and explains what that kind of date means. Whether food is still good also depends on how it was stored, whether it was opened, and how it looks and smells. See the shelf-life guides for storage times, and when in doubt, throw it out.
Is anything I type sent anywhere?
No. The decoder runs entirely in your browser; the text you type is not sent to a server or stored.
Sources
- Food Product Dating — USDA Food Safety and Inspection Service
- AB 660 (2024): Food labeling: quality dates and safety dates — California Legislative Information