A GS1 barcode rarely holds a single value. A serialized medicine carton carries a product code, an expiry date, a batch number, and a serial number in one symbol — and every receiving system in the chain has to separate those values correctly, without knowing anything about the sender. GS1 Application Identifiers (AIs) are the mechanism that makes this possible: each value is preceded by a short numeric label that states what the value is.

The four identifiers you will meet most

There are more than a hundred defined AIs, but four of them do most of the work in item-level traceability.

  • (01) — GTIN. The product identifier, always exactly 14 digits in GS1 element strings. The first digit is a packaging-level indicator, and the last is a check digit.
  • (10) — Batch or lot number. Variable length, up to 20 characters, assigned by the manufacturer.
  • (17) — Expiration date. Always six digits in YYMMDD order: 271231 is 31 December 2027.
  • (21) — Serial number. Variable length, up to 20 characters, unique to the individual item.

Fixed-length and variable-length fields

A parser reads an element string from left to right. When it meets an AI whose field has a fixed length — (01) is always 14 digits, (17) is always 6 — it knows exactly where the value ends and the next AI begins. Variable-length fields such as (10) and (21) are different: the parser cannot know their length in advance, so a variable-length field is either placed last in the string or terminated by a separator character (FNC1 in 2D symbols, encoded as a group separator).

This is also what distinguishes a GS1 DataMatrix from a plain DataMatrix: the GS1 symbol begins with FNC1 in the first position, which is the scanner’s signal that the payload follows the AI rules.

Reading a complete element string

Consider the string printed under a serialized carton, written here the way humans write it, with the AIs in parentheses: (01)10950600013436(17)271231(10)ABC123(21)SN0001.

Reading it field by field: AI (01) introduces a fixed 14-digit GTIN, 10950600013436 — an indicator digit 1 (a grouped packaging level) over the item reference, ending in check digit 6. AI (17) gives a fixed six-digit expiry date, 271231 — 31 December 2027. AI (10) opens the variable-length batch field, ABC123; in the encoded symbol a separator follows it, because another field comes next. Finally AI (21) carries the serial number SN0001, and being last it needs no terminator. The parentheses themselves are never encoded — they exist only in the human-readable text.

Those four fields are not an arbitrary example. GTIN, expiry, batch, and serial are exactly the data elements that pharmaceutical serialization regimes such as the US DSCSA and the EU FMD require on saleable units, which is why this combination appears on so many packs.

One element string, four labelled fieldsParentheses appear only in human-readable text; the symbol carries the AIs, the values, and separators.
(01) GTIN10950600013436Fixed length: always 14 digits
(17) Expiry271231Fixed length: 6 digits, YYMMDD
(10) BatchABC123Variable length, up to 20 characters; separator follows
(21) SerialSN0001Variable length, up to 20 characters; last, so no separator needed

Why systems prefer labelled data

Because every value announces its meaning, a warehouse scanner, a pharmacy system, and an ERP platform can all parse the same symbol with the same rules — no per-supplier formats and no custom splitting logic. When a recall lands, the receiving history already contains batch and expiry for every unit, because the symbol carried them from the start.