How to write GS1-128 data
A GS1-128 barcode is a chain of elements. Each one starts with an application identifier (AI) that says what follows. Type the AI in round brackets, then the value, with no spaces:
(01)10012345000017(17)271231(10)LOT42
That single barcode says: this is GTIN 10012345000017, it expires on 31 December 2027, and it is from lot LOT42. The brackets appear in the readable text under the bars so a person can follow it. They are not encoded in the bars.
The application identifiers you are most likely to need
| AI | Meaning | Format |
|---|---|---|
| (00) | SSCC, the serial number of a pallet or parcel | 18 digits |
| (01) | GTIN of the item or case | 14 digits |
| (02) | GTIN of the items inside a pallet | 14 digits |
| (10) | Batch or lot number | Up to 20 characters |
| (11) | Production date | YYMMDD |
| (13) | Packaging date | YYMMDD |
| (15) | Best before date | YYMMDD |
| (17) | Expiry date | YYMMDD |
| (21) | Serial number | Up to 20 characters |
| (37) | Count of items, used with (02) | Up to 8 digits |
| (3103) | Net weight in kilograms, three decimals | 6 digits |
| (400) | Customer purchase order number | Up to 30 characters |
Rules that trip people up
- The GTIN in (01) is always 14 digits. Pad a UPC or EAN with zeros on the left. This tool checks the length and the check digit and tells you the correct last digit if it is wrong.
- Dates are always six digits. Year, month, day, with no separators. Use 00 for the day when only the month is known.
- Fixed-length elements go first. Put (01), (11), (15) and (17) before (10) and (21). A variable-length element in the middle needs an invisible separator after it, which makes the barcode wider.
- (02) must be followed by (37). Content GTIN and count travel together.
- Weights carry the decimal position in the AI. (3103) means three decimal places, so 001250 is 1.250 kg. (3102) would make the same digits 12.50 kg.
GS1-128 or ITF-14 on a carton?
If the carton only needs to say what product is inside, ITF-14 is simpler and prints better on brown board. Choose GS1-128 when the receiver needs traceability data, which is standard for food, drink, pharmaceuticals and anything with a shelf life. GS1-128 needs a white label or a clean printed panel, because its bars are finer than ITF-14.
Keeping the barcode scannable
GS1-128 grows quickly. The standard caps one barcode at 48 data characters and 165 mm including quiet zones. If your data runs longer, split it across two barcodes on the same label, with the GTIN in the first. For very small items where even a short GS1-128 will not fit, the same data can go in a Data Matrix. For barcodes that carry only your own text with no GS1 structure, use plain Code 128.