Batch Number Generator
Plan batch and lot codes for a production run. Choose a format such as L26324-01 (year, day of the year, batch), set the production dates and batches per day, and get every code with its manufacturing date and an expiry or best-before date worked out from the shelf life.
Dates come from each production day. Add your product, plant or line code as plain text.
What the codes mean
- {YYYY}
- Year, 4 digits
- {YY}
- Year, 2 digits
- {MM}
- Month, 01-12
- {DD}
- Day of month, 01-31
- {DDD}
- Day of the year, 001-366 (Julian day)
- {FY}
- Financial year, e.g. 2026-27
Up to 731 days
The expiry date is the manufacturing date plus the shelf life you enter (a month-end date such as 31 January + 1 month becomes the last day of February). Whether you must print “expiry”, “use by” or “best before”, and how, depends on your product’s labelling rules; this tool does not check them. Nothing is sent or stored.
About Batch Number Generator
A batch or lot number links a pack on a shop shelf back to the day, line and run in which it was made. If a complaint or recall happens, it lets a manufacturer find every affected unit. This tool plans those codes for a whole production period and works out the matching expiry dates.
Reading the formats
The default format is L{YY}{DDD}-{SEQ:2}. For 20 November 2026 that gives L26324-01: L for lot, 26 for the year, 324 for the day of the year and 01 for the first batch that day. Day-of-year codes, often called Julian dates, are popular with food, beverage and cosmetics makers because five digits cover the whole date.
Prefer an ordinary date? B{YYYY}{MM}{DD}-{SEQ:2} gives B20261120-01. Add plant or line letters as plain text, such as P1- for plant one.
Production settings
- Batches per day: two shifts might mean two batches, numbered 01 and 02.
- Batch number: let
{SEQ}start again each day, or keep counting through the whole period. - Skip Sundays: leaves out a weekly closed day.
- Shelf life: days or months added to each manufacturing date.
If two rows end up with the same code, for instance because the pattern has no day in it, a warning appears with an example so you can fix the pattern before printing.
Worked example
A pickle maker produces two batches a day from 1 to 31 December 2026, closed on Sundays, with a 12-month shelf life. With the Julian format the first rows read L26335-01 and L26335-02, made 2026-12-01, expiring 2027-12-01.
Know the limits
Month arithmetic moves impossible dates to the month end: 31 March plus one month is 30 April. Whether a label must say expiry, use by or best before, and in which format, is set by food, drug or packaging rules for your product and market. Check those rules; this page does not.
For counting days between two dates, see the Date Difference Calculator.
How to use Batch Number Generator
- Pick a format or write a pattern with date codes and {SEQ} for the batch number.
- Set the first and last production dates, batches per day and the shelf life.
- Press Create batch numbers, check the table and download the CSV for your label printer.
Privacy: how it works
Codes and dates are worked out in your browser. Nothing is sent or stored.
Frequently asked questions
What is a Julian date code?
The day of the year from 001 to 365 (366 in a leap year), often after the year: 26324 is the 324th day of 2026, 20 November. It is short and common on food and packaging lots.
How is the expiry date worked out?
Manufacturing date plus the shelf life in days or months. When a month is shorter, the date moves to its last day, so 31 January plus one month is 28 February (29 in a leap year).
Does this follow labelling law for my product?
It only makes codes and dates. Rules on what to print, such as use by or best before and the date format, depend on the product and country, so check the regulations that apply to you.