Guides ·

GS1 application identifiers (01), (17), (10) explained

A carton label reads (01)09501101530041(17)270630(10)LEMON42 under the bars. The numbers in brackets are GS1 application identifiers: short codes that say what the next value means. This post explains the three you see most often, the rule that holds them together and the mistakes that break them.

Open a photo or PDF of your label on the free GS1 barcode decoder to see every application identifier named and checked.Try it on your own file
The GS1 barcode decoder with the lemon curd label: GS1-128, OK, with (01) GTIN 09501101530041 check digit OK, (17) expiry date 2027-06-30, (10) batch LEMON42 and (21) serial 7731
lunar-lemon-curd-label.png in the GS1 barcode decoder: each application identifier named and checked. Sample label: unmake's own, product and numbers made up.

What an application identifier is

GS1 is the organisation behind the barcode numbers on retail products. Its application identifiers (AIs) are two to four digits placed in front of a value to say what it is: (01) a product number, (17) an expiry date, (10) a batch. One barcode can hold several such pairs in a row, in GS1-128, GS1 DataMatrix, GS1 QR Code and GS1 DataBar Expanded symbols.

The brackets are only there for people. GS1's General Specifications say the parentheses are not part of the identifier and only aid readability. The bars themselves hold one run of characters, 0109501101530041172706301... without any brackets.

The lemon curd GS1 string cut into its application identifiers: (01) GTIN 09501101530041, (17) expiry 270630 meaning 30 June 2027, (10) batch LEMON42, a separator, then (21) serial 7731
The label's data cut at each application identifier. Diagram: unmake.

(01): the GTIN, always 14 digits

(01) is followed by a GTIN (Global Trade Item Number), the product number. After (01) it always has 14 digits: the shorter GTIN-13 and GTIN-12, the numbers under EAN and UPC barcodes, get one or two zeros in front. That is why 09501101530041 starts with 0.

The last digit is a check digit. Starting from the right, multiply the other digits by 3, 1, 3, 1 and so on, add the results, and the check digit is what brings the total up to the next multiple of 10. For 0950110153004 the sum is 59, so the check digit is 1.

(17): the expiry date, as YYMMDD

(17) is the expiration date, written as six digits: year, month, day. 270630 is 30 June 2027. GS1's suggested text label for it is USE BY or EXPIRY. Related identifiers use the same format but mean something else: (15) is the best before date and (11) the production date.

Two rules surprise people. If the day is 00, the date means the last day of that month, so 270600 is also 30 June 2027; for regulated healthcare products, GS1 no longer allows 00 from 1 January 2025. And the two-digit year is read within a window from 49 years in the past to 50 years in the future.

(10): the batch or lot, up to 20 characters

(10) carries the batch or lot number: up to 20 characters from GS1's character set 82, which allows digits, upper- and lower-case letters and twenty special characters, but no space. It is not part of the product's identity; GS1 says it must be processed together with the GTIN it belongs to.

Unlike (01) and (17), its length varies. That one fact causes most decoding errors, and it is the reason for the separator.

Fixed length, variable length and the separator

A decoder knows where a GTIN ends: after 14 digits. It knows where an expiry date ends: after 6. GS1 calls these predefined-length elements, and they need no separator. A batch has no fixed end, so when another value follows it, the code must contain a separator: the FNC1 character in a GS1-128 barcode, which the scanner passes on as the control character GS (ASCII 29).

GS1 says fixed-length elements should usually come first and variable ones last, so the final value needs no separator at all. Our label follows that order but adds a serial number, (21), after the batch, so it needs exactly one separator, between LEMON42 and 21.

With the separator, the batch is LEMON42 and the serial is 7731; without it, a decoder reads the batch as LEMON42217731 and there is no serial
Why a variable-length field needs a separator. Diagram: unmake.

Reading a GS1 label without a scanner

The GS1 barcode decoder on unmake reads photos, scans and PDFs in your browser, splits each code into its AIs, names them and checks check digits, dates, lengths and GS1 rules against the official GS1 table. Nothing is uploaded.

Type codes takes the printed form with brackets, so you can test a string before you print a single label, and also the raw string as a scanner types it. That is how we produced the broken examples below.

Four typed codes in the decoder: a wrong GTIN check digit flagged with the digit it should end in, the impossible expiry date 270631 flagged, a code without separator marked Check with the likely split LEMON42 plus serial 7731, and a raw scanner string read as GS1
Broken and raw versions of the label's data, typed into the decoder. Screenshot: unmake.

A worked example: a lunar lemon curd case label

  1. The file: lunar-lemon-curd-label.png (900 × 560 pixels), a made-up case label with one GS1-128 barcode encoding (01)09501101530041(17)270630(10)LEMON42(21)7731.
  2. Open files: 1 code found, GS1-128, OK. GTIN 09501101530041 with check digit OK, expiry date 2027-06-30, batch/lot LEMON42, serial number 7731.
  3. Typed with the last GTIN digit changed to 2: Check digit wrong in (01) GTIN (product number): it should end in 1.
  4. Typed with (17)270631 (June has only 30 days): (17) Expiry date is not a real date or time.
  5. Typed with (17)270600: expiry date 2027-06-30 (end of month).
  6. Typed as the raw scan with no separator, starting with ]C1 (the prefix some scanners add for GS1-128): the batch reads LEMON42217731 and the code is marked Check, with the note: Separator probably missing: this Batch / lot may really be “LEMON42” + Serial number “7731”.
  7. Typed as a scanner sends it, with no brackets and no ]C1 (01095011015300411727063010LEMON42): OK, with the note Read as GS1 data, as a barcode scanner types it.

Common mistakes

Questions

What is the difference between (17) and (15)?

(17) is the expiration date, the limit of consumption or use. (15) is the best before date. Both are written as YYMMDD.

What is the ]C1 at the start of some scans?

A symbology identifier that some scanners send to say the code was a GS1-128. It is not part of the data.

Can one barcode hold many AIs?

Yes. Our label holds four: (01), (17), (10) and (21). Order them fixed-length first, and put a separator after each variable-length value that isn't last.

Sample file: lunar-lemon-curd-label.png (made-up GS1-128 case label) · ours (unmake sample; barcode drawn with bwip-js, MIT; product and numbers made up)

Sources

Open a photo or PDF of your label on the free GS1 barcode decoder to see every application identifier named and checked.Try it on your own file