A customer's routing guide says your label needs a GTIN, a lot number and an expiration date in a GS1-128 barcode. The list of numbers in parentheses that follows looks like code. It is really just a labeling system, and a small part of it covers most small-business jobs.
This guide is a reference to the Application Identifiers you are most likely to meet, how to format their data, and where the separator character goes. For how the barcode itself is built, see Code 128 explained.
What an Application Identifier is
An Application Identifier, or AI, is a two- to four-digit prefix that tells a scanner and your software what the data after it means. The GS1 General Specifications pair each AI with a data field, forming an element string. GS1 publishes the complete list in its AI browser; the General Specifications are the authoritative reference.
The parentheses are only for people. They appear in the human-readable text under the bars and are not encoded in the symbol. So (01)00614141999996(10)LOT42 is what you read, while the barcode holds 0100614141999996 followed by 10LOT42.
AIs can ride in GS1-128, GS1 DataMatrix, GS1 QR Code and GS1 DataBar symbols, according to the General Specifications. Your generator choices are narrower: see the last section.
The AIs you will meet most
Formats below come from the General Specifications. N means digits only, and X means letters, digits and a set of symbols.
| AI | Data title | Format | What it holds |
|---|---|---|---|
| (00) | SSCC | 18 digits | Serial number of one pallet, case or parcel |
| (01) | GTIN | 14 digits | The product's GTIN, padded with leading zeros to 14 |
| (02) | CONTENT | 14 digits | GTIN of items inside a logistic unit |
| (10) | BATCH/LOT | Up to 20 characters | Lot or batch number |
| (11) | PROD DATE | 6 digits, YYMMDD | Production or assembly date |
| (13) | PACK DATE | 6 digits, YYMMDD | Packaging date |
| (15) | BEST BEFORE or BEST BY | 6 digits, YYMMDD | End of the period the product keeps its stated quality |
| (17) | USE BY or EXPIRY | 6 digits, YYMMDD | Expiration date |
| (21) | SERIAL | Up to 20 characters | Serial number of one individual item |
| (30) | VAR. COUNT | Up to 8 digits | Item count in a variable measure trade item |
| (37) | COUNT | Up to 8 digits | Number of trade items in a logistic unit |
| (310n) | NET WEIGHT (kg) | 6 digits | Net weight of a variable measure item, in kilograms |
A few notes that save trouble:
- (01) is always 14 digits. A 12-digit UPC-A becomes 00 plus the UPC; a 13-digit EAN gets one leading zero. The GTIN guide explains the padding.
- (10) and (21) describe a GTIN. The General Specifications say a lot number or serial number must be processed together with the GTIN of the item. The lot is not part of the item's identity, but a serial plus a GTIN identifies one individual item.
- (02) and (37) travel together. AI (37) is the mandatory completion of AI (02), and the pair describes what is inside a shipping unit. The SSCC guide shows them on a pallet label.
- (30) is not (37). AI (30) is only for variable measure items, such as something sold by weight. GS1 says it must not state the quantity of a fixed measure item.
Dates: YYMMDD and the "day 00" rule
Every date AI uses six digits: two for the year, two for the month, two for the day. December 31, 2027 is 271231. There is no century in the data; per the General Specifications, a date can only fall from 49 years in the past to 50 years in the future.
The unusual rule is what happens when a day isn't needed. You can fill the day with 00, and the string then means the last day of that month, including leap years. For example, 271200 means December 31, 2027, and 160200 means February 29, 2016.
GS1 notes that for regulated healthcare products, the day can no longer be two zeroes as of January 1, 2025. If you ship anything regulated, use a real day and check your customer's rules.
Pick the date AI by its meaning, because partners read them differently. (15) is for consumer-facing quality, and the General Specifications note that a retailer may use it as a date after which they stop merchandising the product. (17) is the expiration date. Use whichever one your trading partner's specification asks for.
Weights: the n in 310n
The 31nn and 32nn families, among others, belong to variable measure items. The fourth digit, shown as n, tells you where the decimal point sits: 0 means none, 1 means one decimal place, 2 means two, and so on. The value itself is always six digits.
So a net weight of 1.25 kg is (3102)000125. Pounds use the 320n family instead; 2.50 lb is (3202)000250. Net weight AIs identify a variable measure item and should never be used alone, so a GTIN goes with them.
FNC1: when the separator is needed
Several AIs follow each other in one barcode, and the scanner must know where each value ends. GS1 solves this with a delimiter, the FNC1 character in GS1-128, and a short list of AIs whose total length is fixed.
The General Specifications give that list as Table 7-6: AIs beginning 00, 01, 02, 03, 11, 12, 13, 15, 16, 17, 20, 31 to 36, and 41 have predefined lengths. Any other element string needs a separator after it if more data follows, even if its length is fixed in other sections of the standard. Nothing is added after the last element.
Practically: put the predefined-length AIs first and one variable-length AI, such as (10), last. Then no separators are needed.
Worked example
A variable-weight case, lot LOT42, best before June 30, 2027, 1.25 kg, with GTIN 00614141999996:
(01)00614141999996(3102)000125(15)270630(10)LOT42
The first three are predefined, and (10) ends the symbol, so it needs no FNC1. The data runs 16 + 10 + 8 + 7 = 41 characters, under the 48-character limit that GS1 US and GS1 give for GS1-128.
Swap the order to (10)LOT42(01)00614141999996 and the lot number gets an FNC1 after it. The scanner transmits that separator as an ASCII group separator, so your software needs to handle it.
Make one with the generator
In the barcode generator, choose GS1-128 and type each AI in parentheses, such as (01)00614141999996(15)270630. It checks that predefined-length AIs have the right number of characters and verifies the check digit in (00), (01) and (02). It inserts FNC1 where the table requires it, and it keeps the order you type.
It does not check what an AI means: it will not catch a date such as 271399 or a missing (37). That check is yours, so read the date and weight values back against the product. The check digit calculator can confirm a GTIN or SSCC first. The generator makes GS1-128 and plain QR codes, but not GS1 DataMatrix, GS1 QR Code or GS1 DataBar.
Bottom line
Learn the handful in the table, write dates as YYMMDD, and put fixed-length AIs before variable-length ones. Then ask your customer which AIs they want and in what order, because the routing guide decides. Build one sample string, generate it, and scan it into a text editor before you print a run.