Lot Codes and Date Coding for Food Manufacturers: How to Build a Lot Numbering System

By
Alex Uspenskyi
October 1, 2026
Lot Codes and Date Coding for Food Manufacturers - featured image

A lot code is the identifier a manufacturer assigns to a defined quantity of product so that it can be traced back to the ingredients, line, and date that produced it. A good lot numbering system is short enough to print on pack, unique within your records, and tied to production data you can actually look up. A date code is something different: it is the best-before or expiry date. The two are often printed together, but they do different jobs, and confusing them is how recalls get wider than they need to be.

Lot vs. Batch vs. Date Code

Three terms compared: a batch is one production run of a recipe, a lot is a defined quantity identified by one code in your records, and a date code is the best-before or use-by date printed on pack

Definitions vary by company and by regulation, so write yours down. A common working approach: a batch is one production run of a recipe; a lot is the quantity you identify with one code in your records, which may be one batch, part of a batch, or several batches; and the date code is the consumer-facing date. FDA's food traceability rule page defines a traceability lot code as "a descriptor, often alphanumeric, used to uniquely identify a traceability lot within the records of the firm that assigned the traceability lot code." That wording is a good test for your own system: unique, and tied to your records.

What a Lot Code Needs to Do

  • Be unique. Two different production lots should never share a code.
  • Link to production records. The code should lead you to the ingredient lots used, the line, the date, and the checks done on that run.
  • Fit on the pack. If it can't be printed legibly, it won't be used.
  • Survive the supply chain. Customers and retailers will quote it back to you when something goes wrong.
  • Not mislead. CFIA's date marking guidance, for example, advises against using the letters "BB/MA" as part of a lot code because consumers may mistake it for a best before date.

How to Build a Lot Numbering System

Example lot code built from four parts: a plant code, the last digit of the year, the day of the year, and a line letter plus run number

A common structure is a short string of fixed fields. For example, P1-6274-B2 could mean plant P1, year ending in 6, day 274 of the year, line B, run 2. Illustrative only; yours should reflect how your plant actually works.

  1. Decide the lot boundary. A new lot should start whenever something relevant to traceability changes: a new raw material lot goes in, the line is cleaned, the recipe changes, or a shift hands over. Smaller lots shrink the scope of a recall; larger ones are simpler to run.
  2. Pick the fields. Plant, date, line, and run are typical. Add shift or tank only if you would use it.
  3. Keep it readable. Avoid characters that look alike (0 and O, 1 and I) and keep the format fixed so codes can be validated.
  4. Separate it from the date code. Even if the production date is embedded in the lot code, don't rely on it as the consumer-facing date.
  5. Document the rules. Write the format and the lot-boundary rules into a procedure so every shift codes the same way.
  6. Record the links. For every finished lot, record the ingredient lots consumed and where the finished lot shipped.

Lot Codes and FSMA 204 Traceability

Under FDA's food traceability rule, a firm must assign a traceability lot code when it transforms a food on the Food Traceability List, among other triggering activities, and should not create a new code just for shipping. Per FDA, Congress directed the agency not to enforce the rule before July 20, 2028. If you make foods on the list, the lot-boundary decisions above become compliance decisions: your code has to connect inputs to outputs in records you can produce quickly. Our FSMA 204 guide for food manufacturers covers what the rule asks you to keep.

Date Coding in Canada

For Canadian sales, CFIA's date marking guidance states that a best before date is required on prepackaged products with a durable life of 90 days or less that are packaged somewhere other than retail premises, using the words "best before" and "meilleur avant" in the prescribed format. CFIA also notes that if a durable life date is used as the lot code, it must meet those format requirements. Check the current guidance for your specific product before printing.

Where Lot Codes Fail in Practice

  • The same lot code is reused across shifts or lines.
  • Ingredient lots used are recorded on paper and never linked to the finished lot.
  • Rework is folded into a new lot without a record of its source.
  • The code on the case differs from the code in the system.
  • A mock recall takes hours because nobody can go from finished lot to inputs and back.

Rotation and traceability use the same data. Our posts on batch and lot tracking software and FEFO vs. FIFO inventory rotation show how lot-level records support both. IONI’s production and traceability software records batches, lots, and shipments alongside the QuickBooks you already use, so a lot code in the plant links to its inputs and its customers.

FAQ

What is a lot code?

A lot code is an identifier a manufacturer assigns to a defined quantity of product so it can be traced to its ingredients, production line, and date. FDA's traceability rule describes a traceability lot code as a descriptor, often alphanumeric, that uniquely identifies a lot within the assigning firm's records.

What is the difference between a lot number and a batch number?

Companies define them differently. A common approach treats a batch as one production run and a lot as the quantity identified by one code, which can be one batch, part of one, or several. Define yours in writing so everyone codes the same way.

Is a lot code the same as a best-before date?

No. A lot code identifies production for traceability; a best-before or expiry date tells the customer how long the product stays at its best or safe. They are often printed side by side but should be tracked separately.

How do I create a lot code system?

Decide when a new lot starts, choose a short fixed set of fields such as plant, date, line, and run, keep the format readable, document the rules, and record which ingredient lots went into each finished lot.

Do I need lot codes for FSMA 204?

If you handle foods on FDA's Food Traceability List, the rule requires you to assign traceability lot codes for certain activities such as transformation and keep related records. FDA states Congress directed it not to enforce the rule before July 20, 2028.

Our Latest Blog Posts

Interested in Learning More?

Book a free consultation with our expert

Val Verbovetskyi, AI Expert at IONI

Val Verbovetskyi

AI Expert

Book a Call
Arrow icon

Download this article guide line!

Thank you! Download will start soon.
Oops! Something went wrong while submitting the form.
close mark