Works on this device
Batch Code Generator
Make batch codes for your production days by a rule you choose: a date part, a line or plant code and a batch number. Or type a code and read the production date back from it.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Your result
How it was worked out
How to use this generator
- Choose to make codes or to read a code.
- Choose the date part, such as YYDDD (the year and the day of the year). Type a line or plant code and the text at the start if you want them.
- Type the first production day, the number of days and the batches on each day. Choose whether the batch number starts again each day.
- Choose Generate. The table shows every code with its date; a code that is the same as another is marked. Copy the list, or download it as a text or CSV file.
The date parts
- YYDDD: the last two digits of the year and the day of the year from 001 to 366. 14 February 2026 is day 45, so it is 26045. This form is often called a Julian date code, although it is not the astronomical Julian date.
- YDDD: the last digit of the year and the day of the year: 6045. The same code comes back after 10 years.
- YYYYMMDD, YYMMDD and DDMMYY: the calendar date, such as 20260214, 260214 or 140226.
- YYWW: the year and the ISO week (weeks start on Monday; week 1 holds the first Thursday of the year). All days of one week have the same code, so use a running batch number with it.
Reading a code
Type the code, the text at its start (if any) and the form of its date part. The page reads the date part that follows. A short year (26 or 6) is read as the latest date with those digits that is not after the reference date you give, such as today. A date that does not exist, such as day 366 of 2025, is refused.
Worked example
Line A makes three batches on 14 and 15 February 2026. With YYDDD, the line code and a batch number of 2 digits that starts again each day, the codes are 26045A01, 26045A02, 26045A03, 26046A01, 26046A02 and 26046A03.
Read back with the reference date 14 October 2026, the code 26045A01 gives Saturday, 14 February 2026, and the rest of the code is A01. The code 26300 gives 27 October 1926, because 27 October 2026 is after the reference date.
Limits you should know
- The codes follow the rule you choose. Rules for lot coding of food, medicines or cosmetics, and for best-before dates, are set by law and by your customers: check them.
- Brands use their own codes. The page reads only the date forms in its list and does not know the code of a brand.
- The page cannot see codes made before. Keep a record of the codes you use.
- Up to 5,000 codes at a time.