Skip to main content
v2026.11,858 entries · CC-BY 4.0

GS1-128 Barcode: What It Encodes and How Application Identifiers Work

How a GS1-128 barcode encodes GTIN, batch and expiry through application identifiers, with a worked decoding example.

Written and maintained by CASRAI Editorial Board

Last updated

Short answer

A GS1-128 barcode is a Code 128 barcode whose data follows the GS1 rules: each piece of data is introduced by a numeric application identifier (AI) that tells the scanner what comes next, such as a GTIN, batch number, expiry date or serial number. It was formerly called UCC-128, and it is meant for cases, pallets and shipping units rather than retail checkout.

Definition and scope: GS1-128 versus plain Code 128

GS1 US describes GS1-128 as a subset of the Code 128 symbology that can carry up to 48 characters of information. It can hold identification keys (a GTIN, a GLN, an SSCC or a GS1 asset identifier) together with attributes such as batch or lot, serial number, expiration date and country of origin. The SSCC identifies logistic units such as cases, pallets and shipping containers.

Microsoft’s documentation for Dynamics 365 describes GS1-128 as a special case of ordinary Code 128. The difference is a flagging character, Function Code 1 (FNC1), placed as the first data character, which signals that the data must be interpreted according to the GS1 specification. A Code 128 barcode without that flag is just Code 128, and its contents are not AI-structured GS1 data.

GS1 US notes that GS1-128 is often requested on packaging beyond the item level and is not intended for point of sale, because traditional laser scanners cannot read the extra data.

How a GS1-128 barcode is read in practice

What are GS1 application identifiers?

An application identifier consists of two to four digits (GS1 Sweden). It tells the scanner what data follows, its format, its character type, its length, and whether the length is fixed or variable. For example, AI (01) means a 14-digit GTIN follows. The AIs are also printed in parentheses beneath the barcode, next to the information they describe. Examples listed by GS1 Sweden:

  • 00: SSCC
  • 01: GTIN; 02: GTIN of a contained item (used with 37, the number of items in the logistic unit)
  • 10: batch number, up to 20 characters
  • 11: production date; 13: packing date; 15: best-before date; 17: expiry date (dates in YYMMDD format)
  • 21: serial number
  • 310x: net weight in kilograms, where the last digit x gives the number of decimals

What does FNC1 do?

FNC1 appears in two roles. In the double start pattern it flags the symbol as GS1-128 rather than ordinary Code 128. It can also act as the separator that ends a variable-length element when another element follows; the alternative representation of that separator is the ASCII 29 group separator character.

Worked example: (01) (17) (10)

Microsoft’s documentation gives this human-readable line: (01) 09521101530001 (17) 210119 (10) AB-123. Read it left to right:

Element Meaning Length rule (Microsoft)
(01) 09521101530001 GTIN, 14 digits Predefined length: 16 characters including the AI
(17) 210119 Expiration date, YYMMDD: 19 January 2021 Predefined length: 8 characters including the AI
(10) AB-123 Batch number, up to 20 alphanumeric characters Variable length

The parentheses belong to the human-readable line beneath the symbol; they are there so a person can see where each AI starts. Order matters for the encoded data. A variable-length element that is followed by another element needs a separator (FNC1 or the ASCII 29 group separator); none is needed after the last element. Because (01) and (17) have predefined lengths and (10) can run to 20 characters, putting the batch number last avoids a separator entirely, which is the best practice Microsoft describes. Put the batch number before another element and a separator must follow it.

A second example from the same page: under AI 3102, the value 123456 means 1234.56 kg, because the last digit of 3100 to 3105 states the number of decimal places.

Related symbologies

Microsoft’s page lists the GS1 symbologies as follows. GS1 Sweden adds that GS1-128 and GS1 DataMatrix both use AIs to indicate the type of information.

Symbology Form
GS1-128 Linear
GS1 DataBar Linear
GS1 DataMatrix 2D
GS1 QR Code 2D
GS1 DotCode 2D

Where it matters for labs, clinics and receiving

A single scan of a GS1-128 label can capture several elements at once, for example batch and expiry, rather than keying them in. That makes the scanner setup part of data quality. Microsoft explains that the AIM symbology identifier ]C1 marks Code 128 with FNC1 in first position (GS1-128), whereas ]C0 marks Code 128 without it. Some scanners must be configured to add that prefix, and to convert the group separator (ASCII 29) to a printable character, so that the receiving software can split the string into the correct elements. Without the identifier, receiving software has no flag telling it the string is GS1 data rather than ordinary Code 128 text.

Which barcode applies where is a question of the use case. These CASRAI pages cover the neighbouring labelling topics:

Common misunderstandings

  • It is not a different barcode family. It is Code 128 with an FNC1 first character and GS1 data rules.
  • It is not for retail checkout. GS1 US says it is not meant for point of sale because traditional laser scanners cannot read the extra data.
  • The parentheses are not data. They appear in the human-readable line under the barcode.
  • AIs are not all the same length. They have two to four digits, and each AI defines its own data format and length.

FAQ

Is GS1-128 the same as UCC-128?

GS1 US states that GS1-128 was previously called UCC-128.

Can GS1-128 hold a batch number and expiry date?

Yes. GS1 US lists batch or lot, serial number and expiration date among the attributes it can carry, along with identification keys such as the GTIN.

How much can it hold?

GS1 US says up to 48 characters of information.

Is GS1-128 used for retail checkout?

No. GS1 US says it is not intended for point of sale.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about GS1-128 Barcode: What It Encodes and How Application Identifiers Work

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.