GS1 DATA TOOL
GS1 AI parser
Turn strings such as (01)…(17)…(10)… into a readable field table with GTIN, dates, lot and serial data.
Inputs
Results
Run the sample to see decoded fields and checks.
ON THIS DEVICE
Recent history
RULES USED
Method and formulas
Known fixed-length AIs consume their specified length. Variable fields stop at ASCII 29; parenthesized input provides explicit boundaries.
The parser covers common AIs and flags unknown values. Use the current GS1 General Specifications for uncommon or sector-specific identifiers.
GUIDE
What this tool does
The GS1 Application Identifier Parser decodes element strings containing numeric Application Identifiers that prefix data fields in GS1 barcodes and RFID tags. It interprets parenthesized syntax such as (01)09506000134352(17)271231(10)LOT-2048(21)SN00042, FNC1 or ASCII 29 separated sequences, and raw scanner streams. Fixed-length AIs consume their exact character count while variable-length fields terminate at the group separator. Supply chain analysts, warehouse software developers, and label printers rely on this parser to validate encoded product, date, lot, and serial information without external dependencies. Browser-local execution keeps all input strings private during analysis of production or test data. The parser supports the most frequently used identifiers from the GS1 General Specifications, including those for GTINs, serial shipping container codes, batch numbers, expiration dates, and serial numbers. It distinguishes between fixed-length numeric fields and variable-length alphanumeric fields by consulting an internal reference of AI lengths and data types. This approach allows accurate segmentation even when separators are omitted after fixed-length values.
Worked example with realistic numbers
Consider the input (01)09506000134352(17)271231(10)LOT-2048(21)SN00042. The parser identifies AI 01 as a 14-digit GTIN consuming the next fourteen characters after the identifier. AI 17 follows as a six-digit expiration date. AI 10 captures the variable lot until the next AI or separator. AI 21 extracts the serial number. A table of results shows each AI, its meaning, extracted value, and length consumed.
| AI | Meaning | Value | Length |
|---|---|---|---|
| 01 | GTIN | 09506000134352 | 14 |
| 17 | Expiration date | 271231 | 6 |
| 10 | Batch/lot | LOT-2048 | 8 |
| 21 | Serial | SN00042 | 7 |
Second worked example
A second input string (00)123456789012345678(10)ABC123(17)250630 demonstrates handling of an 18-digit SSCC followed by a variable batch and a six-digit date. The parser consumes the full 18 characters after AI 00, then treats AI 10 as variable until the next identifier and extracts the expiration date from AI 17.
| AI | Meaning | Value | Length |
|---|---|---|---|
| 00 | SSCC | 123456789012345678 | 18 |
| 10 | Batch/lot | ABC123 | 6 |
| 17 | Expiration date | 250630 | 6 |
Formula and method table
| Input format | Processing rule | Output fields |
|---|---|---|
| Parenthesized | Explicit AI and value boundaries | AI code, data value, type flag |
| GS-separated | ASCII 29 terminates variable fields | Parsed segments, remainder |
| Fixed-length AI | Consume exact digit count | Value plus next position |
Units and conversions notes
| AI | Data type | Format or unit | Conversion notes |
|---|---|---|---|
| 01, 02 | GTIN | 14 digits | Numeric string only |
| 10, 21 | Alphanumeric | Variable characters | Preserve hyphens and spaces |
| 11, 15, 17 | Date | YYMMDD | Base year 2000 |
| 00 | SSCC | 18 digits | Numeric string only |
| 90+ | Custom | Variable | Flag for manual review |
Dates appear in YYMMDD format and require conversion to full calendar dates using a 2000 base year for most modern strings. GTIN values remain numeric strings without check-digit recalculation by this parser. Lot and serial fields preserve original alphanumeric characters including hyphens. Length units are always characters; no metric conversions apply. When an AI 90 or higher appears the parser flags it as potentially sector-specific and leaves the value intact for manual review.
Limitations
The parser recognizes only the most common AIs listed in the GS1 General Specifications. Rare or newly introduced identifiers trigger an unknown flag and stop further processing. It does not validate check digits on GTINs or convert Julian dates. Extremely long element strings exceeding typical scanner buffers may truncate before the final separator. No support exists for binary or compressed GS1 formats used in certain EPC schemes. The tool cannot interpret concatenated AIs that violate length rules or handle encrypted payloads. Sector-specific extensions beyond AI 90 require external lookup tables not included in the parser.
Common mistakes
- Omitting the group separator after a variable-length field causes the next AI to be misinterpreted as data.
- Entering a six-digit date without confirming YYMMDD order leads to incorrect expiration interpretation.
- Treating parenthesized input as raw scanner output wastes the explicit boundary information the parser can exploit.
- Ignoring the unknown-AI flag on sector-specific codes such as AI 95 may hide critical traceability data required by regulations.
- Assuming all AIs are fixed length results in premature termination of variable fields like lot numbers.
- Supplying input containing non-GS1 prefixes without stripping them first produces offset errors in value extraction.
- Overlooking that AI 00 requires exactly 18 digits after the identifier leads to incomplete SSCC parsing.
COMMON QUESTIONS
Frequently asked questions
How does the parser distinguish a fixed-length AI 01 from a following variable AI 10 when no separators exist?
It consumes the mandatory fourteen characters after AI 01 then looks for the next two-digit identifier. Any remaining characters until ASCII 29 or a new AI belong to the subsequent field.
What output occurs when an unrecognized AI such as 95 appears in the middle of a string?
The parser records the unknown AI code, copies the following data until the next boundary, and sets a warning flag without halting on later known identifiers.
Does the tool recalculate the GTIN check digit during parsing?
No. It extracts the fourteen-digit string verbatim and leaves check-digit validation to separate routines.
How are YYMMDD dates from AI 17 converted for display?
The parser returns the raw six digits; downstream code must map YY to 2000+YY and format the resulting calendar date.
What happens if a variable-length field lacks a terminating ASCII 29 before the string ends?
The parser treats all remaining characters as the final field value and marks the element string as potentially incomplete.
Can the parser process concatenated GS1-128 data that includes FNC1 characters?
Yes. FNC1 is treated identically to ASCII 29 for terminating variable-length fields and is stripped from output values.
Are there length limits on individual AI values beyond the GS1 specification?
The parser enforces the published maximum lengths for each known AI and rejects or truncates values exceeding those limits.
How does the parser behave with AI 90-99 identifiers used in healthcare or defense sectors?
It flags them as uncommon, extracts the value up to the next boundary, and recommends consulting the current GS1 General Specifications for correct interpretation.