Food date coding is the practice of marking a product with dates and codes: open dates that a shopper can read (“best by,” “use by,” “sell by”) and closed codes the plant reads (Julian dates, lot codes, line and shift stamps). The surprising part for most people is that, in the United States, product dating is not required by federal regulation for almost any food. The dates are about quality, not safety, and the one true exception is infant formula.

This post sorts out what each date phrase means, how a closed code like a Julian date works, who actually requires dating (federal versus state), and why the code you stamp for consumers is the same code that decides how wide your next recall has to be.

What is food date coding?

Food date coding is the set of marks a manufacturer applies to a package to communicate quality timing and to identify the production lot. It splits into two purposes. Open dating is human-readable and aimed at consumers and retailers, a calendar date with a phrase. Closed or coded dating is aimed at the manufacturer, a Julian date, lot number, or line/shift code that lets the plant trace exactly when and where a unit was made. A single package often carries both: a friendly “BEST BY 10/2026” and a cryptic “26290 A2” nearby.

What do best-by, use-by, and sell-by mean?

These phrases are mostly about quality, and, outside infant formula, they are not federally defined safety dates. USDA and FDA have encouraged the food industry to standardize on “Best if Used By” to reduce confusion and food waste, but the phrasing on shelves still varies.

PhraseWho it is forWhat it means
Best if Used By / Best ByConsumerPeak quality date. Not a safety date; food is often fine after, if handled well.
Use ByConsumerLast date for peak quality. Not a safety date, except on infant formula, where it is mandatory and meaningful.
Sell ByRetailerGuides stock rotation; how long to display the product for sale. Not a consumer safety date.
Freeze ByConsumerWhen to freeze to maintain quality. Not a purchase or safety date.
Julian / lot codeManufacturerClosed code identifying the production date and lot for traceability.
USDA's Food Safety and Inspection Service is explicit that, except for infant formula, these dates indicate quality rather than safety. “Use By” only functions as a safety date on infant formula.
One package, two audiences: the open date and the closed code The two codes on a package speak to two readers BEST IF USED BY OCT 2026 26290 A2 OPEN DATE consumer · quality CLOSED CODE plant · traceability day 290, 2026, line A2 the friendly date sells the product; the closed code decides your recall
The open date manages quality and consumer trust. The closed code is the one that matters at 2 a.m. when you have to identify exactly which lot to pull.

How does a Julian date code work?

A Julian date code encodes the day of the year, usually with the year, in a compact form the plant can print fast and read reliably. The common format is a three-digit day-of-year (001 for January 1 through 365 or 366 for December 31), often prefixed or suffixed with a year digit and followed by a line, shift, or plant code. So “26290” reads as year 2026, day 290, which is October 17. Add “A2” and you also know the line and shift.

Julian coding is popular because it is unambiguous on a production line, avoids the month/day ordering confusion that trips up international shipments, and packs date plus lot identity into a few characters. The exact scheme varies by company, there is no single legal format, so the meaning of a code only exists if your plant documents its own key.

The tradeoff is human-friendliness. A Julian code is fast for a machine and a trained quality tech but opaque to a shopper, which is why most consumer packages pair it with an open date. The engineering that matters is on the production side: the code has to be printed legibly and verified on every unit and case, because a smudged or missing code is a hole in your traceability that only shows up when you need it most. Plants that ink-jet a code onto a fast line usually add a vision check to confirm the code is present and readable, and they define what happens to product that fails that check.

Decoding a Julian date and lot code Reading “26290 A2” 26 290 A 2 year 2026 day of year 290 = Oct 17 line A shift 2 no universal format, the code only means something if your plant documents its key
A Julian code compresses date and lot identity into a few printable characters. Because schemes vary by company, the decode key belongs in your documented procedures.

Is food dating required by law?

Federally, almost never. With the single exception of infant formula, there is no US federal regulation requiring a date on food, and no federal standard for what the date phrases mean. Dating is largely voluntary, driven by industry practice, retailer requirements, and consumer expectation. What regulation exists is mostly at the state level, and it is a patchwork: some states require sell-by or use-by dates on specific perishables like dairy or shellfish, some regulate the sale of past-date product, and many require nothing at all. If you ship nationally, you comply with the strictest state rule for each product category, not a single federal one.

Two practical consequences fall out of this. First, the phrase you print is a business and food-waste decision as much as a compliance one, which is why USDA and FDA have pushed the industry toward a single voluntary standard, “Best if Used By,” to cut the confusion that leads consumers to throw away good food. Second, whatever the open date says, it does not relieve you of the closed code. The federal system is comfortable with a mostly-voluntary open-dating world precisely because the traceability that protects public health rides on the lot and date code, not on the friendly phrase. That is the part regulators care about, and it is the part that has to be right.

Why is infant formula the one exception?

Infant formula is the only food FDA requires to carry a date. Under 21 CFR part 107, every container must show a “use-by” date through which the formula, if handled and stored properly, will contain the required nutrients and be of acceptable quality. The manufacturer sets the date from stability testing. Here the date is meaningful in a way it is not for most foods: it is tied to guaranteed nutrient content for a population that depends entirely on the product, which is why USDA and FDA describe infant-formula “use by” dates as functioning like a safety date rather than a quality suggestion.

How does date coding support traceability and recalls?

The closed code is where date coding stops being a marketing choice and becomes a food-safety tool. When something goes wrong, the lot and date code are how you translate “there is a problem” into “pull these specific pallets and leave the rest of the year's production alone.” A precise, well-controlled code lets you recall narrowly; a sloppy or missing one forces you to recall wide, because you cannot prove which product is affected.

This is the same logic that drives modern traceability rules. FDA's FSMA 204 traceability rule requires detailed lot-level records for designated high-risk foods, and lot/date coding is the backbone that makes those records usable. Those lot records also have to be kept and retrievable on demand; when they are electronic, they fall under 21 CFR Part 11 controls. Your date code should tie directly into your broader traceability system and your recall plan and you should prove it works with a mock recall that starts from a code on a package and reconstructs the lot in both directions. In a pathogen event, an E. coli O157:H7 recall, say, that precise lot code is the difference between pulling a few pallets and pulling a season.

  1. Define the code scheme. Decide what the code encodes, date, line, shift, plant, and write the decode key into your procedures so anyone can read it.
  2. Apply it reliably. Print and verify the code on every unit and case; an unreadable or missing code is a traceability hole.
  3. Tie the code to the lot record. Link each code to production records: raw-material lots, batch records, and the checks run that shift.
  4. Keep the records retrievable. Store lot and date records so they can be pulled fast and connected forward to customers and back to suppliers, the FSMA 204 “one step forward, one step back” expectation.
  5. Test it with a mock recall. Start from a random code and prove you can identify, locate, and quantify the affected lot within your target time.

By the numbers

The regulatory reality of food dating, from primary sources:

Date coding sits at the seam between marketing and food safety: the friendly date builds consumer trust, but the closed code decides whether a bad day costs you one lot or one month. Keeping the code, the batch record, and the check data connected, so a code on a package instantly resolves to a full lot history, is the kind of connected-records workflow Harmony runs on the plant floor. Handled well, your date code is also a control that keeps recalls narrow, which is exactly why it belongs inside your HACCP-based food-safety system rather than bolted on at the printer.