GS1 and logistics
GS1-128 with a date and a batch — putting more than a number in a barcode
Application identifiers let one barcode hold the product number, the expiry date, the batch and the serial number. How to put them together, what to watch and where the limits are.
6 min read
An EAN-13 barcode carries one piece of information: the product number. That is enough at the till, but not in a warehouse, where you need to know which batch it is and how long it keeps.
That is what GS1-128 is for.
The application identifier
The idea is simple. Each value is preceded by a two-, three- or four-digit prefix that says what the value means. The prefix is called an application identifier, or AI for short.
The most common ones:
| AI | Meaning | Format |
|---|---|---|
| (01) | GTIN product number | 14 digits |
| (10) | Batch number | up to 20 chars |
| (11) | Production date | YYMMDD |
| (15) | Best before date | YYMMDD |
| (17) | Expiry date | YYMMDD |
| (21) | Serial number | up to 20 chars |
| (00) | Serial Shipping Container Code (SSCC) | 18 digits |
| (37) | Count of items in the unit | up to 8 digits |
A full string looks like this:
(01)05901234123457(17)261231(10)ABC123
It reads: product number 05901234123457, use by 31 December 2026, from batch ABC123.
The brackets that are not there
The most common misunderstanding: the brackets are not encoded in the barcode. They are notation for people, so you can see where one identifier ends and the next begins.
In the barcode itself, variable-length fields are separated by a control character, FNC1, which the encoder inserts where it is required. You do not type it in, and you cannot type it from a keyboard.
That is why in the GS1 tool you enter the values in separate fields, and the brackets appear by themselves in the preview of the string. A scanner that reads such a barcode hands the system separate fields, not one long string.
Dates as YYMMDD
Dates are written as six digits: two for the year, two for the month, two for the day. 261231 is 31 December 2026.
Two traps:
The order. It is year-month-day, not day-month-year. 311226 is not a valid date and will be rejected, but 010203 is valid and means 3 February 2001 — not 1 February 2003. A typo in a date does not always give an error; sometimes it gives a different date.
Day 00. When only the month is known, the day is written as 00: 261200 means "December 2026". That is a valid entry, not a mistake.
The tool checks whether the date exists at all — 260230 will be rejected, because February does not have thirty days.
Check digits
GTIN (01), SSCC (00) and GLN (410, 414) numbers end in a check digit. That is what catches a copying mistake.
The tool calculates it for you: type the number without its last digit and click "Add the check digit". If you type a full number with the wrong digit, the message tells you which digit should be there — not just "error".
How much fits
Here is a real limit, and it is worth knowing about before you design the label.
GS1-128 holds at most 48 characters of data, counting the identifiers but not the brackets. The example above takes 32: 2 + 14 for the product number, 2 + 6 for the date, 2 + 6 for the batch. Adding a serial number 15 characters long would go over the limit.
When the data does not fit in GS1-128, there are two ways out:
- GS1 DataMatrix — a two-dimensional, square barcode that holds far more and takes less space. It is used on small packages, medicines among them.
- Splitting it into two barcodes on the same label.
In the tool, a counter under the string shows how many characters are used and how many are left for the chosen carrier. Switching the carrier changes the limit at once.
The order of the fields
The standard does not impose one order, but practice does. The convention is to start with (01) and to put the variable-length fields — (10), (21) — at the end, because each of them needs a separator, and separators take up space and make the barcode longer.
Some industries have their own requirements for the order and the set of fields. If the label is going to a particular customer, their specification matters more than general practice.
The logistics label
GS1-128 usually does not appear on its own, but as part of the standard GS1 logistics label — the one stuck on pallets and cases. It has a fixed layout: the data in human-readable form at the top, the barcodes below, and the SSCC at the very bottom, because that is what identifies the shipment.
If you mark cases with the number alone, without a date and batch, the simpler way is ITF-14, which carries only the GTIN-14 and copes better with printing on corrugated board.
How to start
- Open the GS1 tool — it starts with a ready example.
- Choose the identifiers and enter the values. The hint under each field says how many characters it expects.
- Keep an eye on the character counter.
- Choose the carrier: GS1-128 for a logistics label, GS1 DataMatrix for a small package.
- Download the barcode, or go on to the generator to set the size and colours.
If you have a ready string from a system and want to see what is in it, paste it into the same tool — it breaks it into fields. A barcode scanned from a real label is taken apart by the reader, along with the names of the identifiers and the dates it read.
How the receiving system reads it
It is worth knowing what happens on the other side, because it explains why the format is the way it is.
A scanner that reads a GS1-128 barcode does not hand the system one long string. It hands over separate fields: the product number, the date and the batch, each on its own. The receiving system does not have to parse anything or agree with you on which order you put things in.
That is why the barcode starts with an FNC1 character — it tells the scanner that the content is a GS1 string with identifiers, not plain text. The same pattern of bars without FNC1 is an ordinary Code 128 and will be read as one string.
The practical consequence: a GS1-128 barcode cannot be replaced by a Code 128 with the same content. They look alike, but they mean different things.
The most common mistakes
Typing the brackets as characters. The brackets are notation; typed in literally, they end up in the data and break the reading.
A date in reverse order. YYMMDD, not DDMMYY. Some wrong dates will be rejected; others will quietly turn into a different valid date.
A GTIN without the leading zero. The (01) identifier needs fourteen digits. The thirteen-digit number from the package is padded with a zero in front.
Going over the capacity. The counter in the tool shows how many characters are left. Better to notice before you design the label than after.
Sources
Where we state a price, a date or a standard, we say where it came from and when we checked it. Sources change without our involvement.