Decode a code
Example shown: 26298, a best-by date 45 days from today. Type only the date part. Letters and extra numbers around it, such as a plant or time code, are not part of the date.
Your pull rule and shelf life are your own settings. Use what you agreed with the store or what the manufacturer tells you.
The common formats
A day-of-year code counts days from January 1, so January 1 is day 001 and December 31 is day 365, or day 366 in a leap year. These codes are often called Julian dates in the food business. The same three digits stand for different calendar days in a leap year and a normal year after February 28, which is why the year matters.
| Format | How to read it | Example | Means |
|---|---|---|---|
YYDDD | Two-digit year, then the day of the year | 26298 | Day 298 of 2026: October 25, 2026 |
YDDD | Last digit of the year, then the day | 6298 | Day 298 of a year ending in 6. The decoder picks the year ending in that digit that is closest to the check date. |
DDDYY | Day of the year, then the two-digit year | 29826 | Day 298 of 2026: October 25, 2026 |
YYYYDDD | Four-digit year, then the day | 2026298 | Day 298 of 2026: October 25, 2026 |
DDD | Day of the year only | 298 | Day 298 of whatever year you choose |
A five-digit code can be read two ways. 26298 is October 25, 2026 as YYDDD, but read as DDDYY it would be day 262 of 2098, which no snack on a shelf today carries. When you are not sure, choose “Not sure” and the decoder lists every reading that makes a real date, so you can rule out the impossible ones. If one package from a product line has a plain date next to its code, decode that code first to learn which format the line uses.
Made date or best-by date
A date code tells you a day. It does not tell you what that day means. On one product line it is the day the bag was made, and on another it is the last day of best quality. That difference decides whether you subtract days or add them, so settle it before you pull anything.
- Best-by, use-by or sell-by date. USDA describes these dates as quality and inventory dates, not safety dates, with infant formula as the exception. “Best if Used By” marks best flavor or quality, and “Sell-By” tells the store how long to display the product. If the code is one of these dates, set the decoder to The best-by date and the days left are counted straight from it.
- Made or packed date. USDA describes a closed or coded date as letters and numbers a manufacturer puts on a package to identify when it was produced. If the code is a made date, choose The day it was made and enter the product’s shelf life from the manufacturer. The decoder adds the shelf life to find the best-by date.
- Egg-style pack dates. Egg cartons that carry the USDA grade shield show the day they were packed as a three-digit day of the year, with January 1 as 001. Illinois egg rules call this a Julian pack date. When a snack code uses the day of the year, it reads the same way.
USDA says food without signs of spoilage may be sold, bought, donated and eaten after its “Best if Used By” date, and federal rules require a date only on infant formula. Whether a store keeps a product past its date is a matter of state law, the store’s own policy, and your agreement with the store. The expired snack rules by state page covers each state.
Learn a product line’s format
Each manufacturer picks its own code, and it can differ between product lines from the same company. These steps work out the format for a line you carry:
- Find a package with a plain date and a code. Many bags and boxes print both. Try each format in the decoder until the code matches the printed date, or lands a set number of days before it, which tells you the shelf life.
- Check the manufacturer’s consumer page. Some companies explain their date codes in an FAQ or will tell you through their consumer contact line.
- Ask your supplier or the manufacturer’s rep. They read these codes every day and can tell you which part of the line is the date.
- Write it down once. Keep a list of each product line’s format and shelf life with your pull rule, so every driver reads codes the same way.
Turn a date into a code
Going the other way helps when you write your own codes on product you bag, or when you want to know what code to look for on the shelf.
Check a list of codes
Put one code per line, with the item name after it if you like. Every line uses the format and settings below. The list is saved in this browser so it is still here next time.
The starting lines are made-up examples dated around today. Replace them with your own.
Pull rule and check date come from the decoder above: .
Day-of-year calendar
A printed chart in the truck is the fastest way to read codes without a phone. Find the day number in the grid: the row is the day of the month and the column is the month. It follows leap years.
Questions
Why do snacks use a code instead of a plain date?
A plain date is printed for shoppers. A code is mainly for the manufacturer. USDA describes a closed or coded date as letters and numbers a manufacturer applies to identify when a product was made, and says codes on cans help with stock rotation and recalls rather than telling shoppers when to eat the food. Some packages carry both a plain date and a code.
Is a day-of-year code the made date or the best-by date?
It can be either, and nothing in the digits tells you which. Check the manufacturer’s own explanation, or compare one package that shows both a plain date and a code. If the code is the made date, you need the product’s shelf life from the manufacturer to know when it goes out of date.
What does the decoder do with a one-digit year?
A YDDD code such as 6298 only gives the last digit of the year. The decoder uses the year ending in that digit that is closest to your check date. When two years are equally close, it uses the earlier one. For snacks that sell within months, that is the only sensible reading.
Does a leap year change the code?
Yes, after February. Day 060 is February 29 in a leap year and March 1 in other years, and every later day shifts by one. 2028 is the next leap year. The decoder and the calendar follow the real calendar for the year you pick.
Can a store keep selling a snack after its date?
For most packaged snacks federal law does not set a sale deadline, and state rules vary. Our expired snack rules by state page covers each state with its official source.
Is anything I type sent anywhere?
No. Decoding happens in your browser, and your list and settings are saved only in this browser on this device. Google Analytics records that the decoder was used, but not your codes or items.
Related tools
Sources
- Food Product Dating, USDA Food Safety and Inspection Service. Meaning of best-by, sell-by and use-by dates, closed or coded dates, the egg pack date, and infant formula as the only federally required date.
- Letter to the food industry on “Best If Used By”, U.S. Food and Drug Administration, May 23, 2019.
- 8 Ill. Adm. Code 65.30, consumer container labeling for eggs, Illinois General Assembly. The three-digit Julian pack date.
Credits and stales, written down at the shelf.
Tallysnack records every expired item a driver pulls, with its credit on the invoice, so the office sees what came back from which store. We are building it now. Join the list for monthly updates on the build.
Who we are. Tallysnack makes route software for direct store delivery (DSD) snack, candy and beverage distributors. It’s built by a family that has run snack routes for more than 30 years, and it is in development. See how it works