Decode one
Scan or paste a barcode and see every part of it.
Make one
Generate a valid barcode from fields.
Where you’ll see it
- Pallet and case labels. The GS1 logistics label identifies each pallet with an SSCC (serial shipping container code) in a GS1-128 barcode.
- Food and healthcare, where cases need batch numbers and expiry dates.
- Not at checkout. GS1-128 is for distribution. Retail items carry a UPC, an EAN or a GS1 DataBar.
Anatomy
FNC1 marks the barcode as GS1
A GS1-128 barcode is a Code 128 barcode with a special character, FNC1, straight after the start code. That’s the only difference in the bars. A scanner that sees it knows to treat the data as GS1, and some scanners report it by putting]C1 in front of the data.
Application Identifiers
The data is a series of fields, each starting with an Application Identifier (AI) of 2 to 4 digits:
There are hundreds more. See the GS1 AI table.
The parentheses in the printed text are only for people. They aren’t encoded, so the scan of the example above is
01095212345678991727123110ABC123.
Separating variable-length fields
Fields like01 and 17 always have the same length, so a parser knows where they end. Fields like 10 vary in length. When one is followed by another field, the barcode ends it with another FNC1, which scanners send as the control character GS (ASCII 29).
That’s why the example puts the batch last: it’s the only variable-length field, and the last field needs no separator.
Size and quiet zones
GS1-128 on logistics labels uses modules from 0.495 mm to 1.016 mm, with bars at least 31.75 mm tall. A barcode can hold at most 48 data characters, and the quiet zones are at least 10 modules on each side.Check digits
The data is checked twice. The barcode ends with the Code 128 mod-103 check character, which scanners verify and drop. Inside the data, a GTIN or SSCC carries its own GS1 mod-10 check digit, which stays in the data and is worth validating. See Check digits.Variants and related types
- Code 128: the barcode underneath, without FNC1.
- GS1 DataMatrix: the same GS1 data in a small 2D barcode, common in healthcare.
- GS1 DataBar: GS1 data for items sold at retail.
- ITF-14: a case barcode that carries only a GTIN.
Gotchas
- Fields run together. That’s normal: the parentheses aren’t in the data. See parentheses missing from the scan.
- A missing separator. Keyboard-style scanners often drop the GS character, which leaves no way to tell where a batch number ends. See invisible characters.
- Don’t split on the AI digits. The same digits can appear inside a value. Parse the fields in order, using each AI’s known length.
- Two-digit years.
271231is December 31, 2027. Dates in GS1 data have no century, and GS1 defines how to infer it.
Scanning it in your app
GS1-128 is in the Logistics and shipping and GS1 groups. ZipZapKit parses the fields for you:Specification
- GS1 General Specifications: Application Identifiers, FNC1, and size and placement rules.
- ISO/IEC 15417: the Code 128 barcode specification.