What Is GS1-128?
Definition
GS1-128 is a GS1 standard that carries multiple pieces of data in a single barcode using the Code 128 symbology. Information such as GTIN, lot number, expiry date and serial number can be encoded together in the same barcode.
It is built on Code 128; what separates GS1-128 from an ordinary Code 128 is that the data is structured with prefixes called Application Identifiers (AIs). This lets the reading system know what each field means.
To decode a GS1-128 element string, use the GS1-128 parser.
What an Application Identifier is
An Application Identifier (AI) is a 2-4 digit prefix defining what the data after it represents. It's shown in brackets for human readability; for example (01) GTIN, (17) expiry date, (10) batch/lot, (21) serial number.
Thanks to AIs, a single barcode carries different kinds of data together in a clear, standard way. So when a warehouse or store system reads the barcode, it knows without doubt which part is the GTIN and which is the date.
The AI catalog is defined by GS1 and shared worldwide, letting different countries and companies use the same structure.
Fixed and variable lengths
Some AIs are fixed length; for example (01) GTIN is always exactly 14 digits and (17) expiry is always 6 digits (YYMMDD). These fields have clear boundaries when reading.
Other AIs are variable length; for example (10) lot or (21) serial number can be of different lengths. These fields are terminated by a separator character (FNC1 / group separator) so it's clear where they end.
A parser knows the fixed lengths and splits variable fields at the correct boundary; brackets are only for display and don't appear in the real barcode.
Typical AI examples
The most common AIs are: (00) SSCC (shipping container code), (01) GTIN, (10) batch/lot number, (11) production date, (17) expiry date, (21) serial number and (30) count.
For example, the string (01)09506000134352(17)260101(10)ABC123 means GTIN 09506000134352, expiry 2026-01-01 and lot ABC123. This is typical in sectors requiring traceability such as pharma and food.
You can also validate the check digit of the GTIN in the (01) field with the GTIN validator.
Uses and limits
GS1-128 is common in logistics, supply chain, and food and pharma traceability, because it can carry critical data like lot and expiry in one barcode. The same AI structure is used in GS1 DataMatrix.
If you only want to check Code 128 character validity, see the Code 128 validator; for the conceptual basis, read what is Code 128.
GS1-128 decoding parses the string's structure; it does not confirm the fields are real or registered. The correctness of the data is the responsibility of the system that produced it.