GS

GS1 DATA TOOL

GS1 element string validator

Find data-structure errors before encoding a GS1-128, GS1 DataMatrix or another compatible carrier.

01

Inputs

Runs locally
02

Results

GS

Run the sample to see decoded fields and checks.

ON THIS DEVICE

Recent history

RULES USED

Method and formulas

The value is parsed into AIs, then each supported field is checked for length, character set, date shape and applicable GS1 check digit.

Production check

Data validation is not printed-symbol verification and does not measure quiet zones, contrast, modulation or print quality.

GUIDE

What this tool does

The GS1 element string validator examines concatenated application identifier data strings to confirm correct AI parsing, field lengths, numeric-only constraints, GTIN and SSCC check-digit calculations, date formatting in YYMMDD, and proper use of variable-length field separators. It accepts input such as (01)09506000134352(17)271231(10)LOT-2048 and breaks the string into individual AIs before applying domain-specific rules for each supported identifier. Users employ the validator when preparing master data for EPCIS events, generating barcode content for logistics labels, or auditing existing element strings prior to transmission to trading partners. The process occurs entirely in the browser without server submission, preserving confidentiality of production identifiers. Additional checks cover AI 00 for SSCC, AI 21 for serial numbers, AI 30 for variable count, and AI 37 for count of units, ensuring each extracted value satisfies its defined character set and maximum length from the GS1 General Specifications.

Worked example with realistic numbers

Consider the element string (01)09506000134352(17)271231(10)LOT-2048. The validator first isolates AI 01 followed by 14 digits, confirming the GTIN-14 value 09506000134352. It recalculates the check digit using the standard modulo-10 weighted sum and reports a match. Next it extracts AI 17 and verifies the six-character date field 271231 represents 31 December 2027. Finally it processes AI 10, accepts the alphanumeric batch LOT-2048, and notes that the variable-length field terminates correctly at the end of the string or before a subsequent AI. A summary table displays each AI, extracted value, length compliance, check-digit result where applicable, and date validity.

AIValueLength CheckCheck DigitDate Valid
010950600013435214 digitsPassN/A
172712316 digitsN/APass
10LOT-20481-20 charsN/AN/A

Second worked example

A second input (00)345678901234567890(21)ABC123456 examines an SSCC followed by a serial number. The validator isolates AI 00, confirms exactly 18 numeric characters, and validates the check digit via weighted modulo-10 arithmetic. It then processes AI 21, accepts the alphanumeric serial up to 20 characters, and confirms no length violation or disallowed characters. The resulting report flags both AIs as compliant while noting that AI 00 requires the leading zero for SSCC-18 formatting.

AIValueLength CheckCheck DigitDate Valid
0034567890123456789018 digitsPassN/A
21ABC1234561-20 charsN/AN/A

Formula and method table

InputUnit or FormatProcessing StepOutput
Element stringParentheses or FNC1 delimitedAI extractionList of AI-value pairs
GTIN-14 digits14 numeric charactersModulo-10 check digitPass or fail flag
SSCC digits18 numeric charactersModulo-10 check digitPass or fail flag
Date fieldYYMMDDRange validation 00-99 for yearISO date or error
Variable AIAlphanumeric up to max lengthCharacter set and length testCompliance status

Units and conversions notes

Date fields always use two-digit year, two-digit month and two-digit day without separators. The validator converts YY to a four-digit year by assuming 00-49 maps to 2000-2049 and 50-99 maps to 1950-1999, then checks that the resulting calendar date exists. Numeric AIs reject any non-digit characters except the explicit FNC1 separator represented by the GS1 specification. Length limits follow the GS1 General Specifications for each AI; for example AI 10 accepts 1 to 20 characters while AI 01 strictly requires exactly 14 digits. No unit conversion occurs for weights or dimensions because the validator only examines syntax, not semantic content such as kilograms or millimetres. The fuller reference table below summarises additional formats.

AITypical UnitFormat ConstraintMax LengthExample Value
00SSCC-1818 digits18345678901234567890
01GTIN-1414 digits1409506000134352
10Batch/lotAlphanumeric20LOT-2048
17DateYYMMDD6271231
21SerialAlphanumeric20ABC123456
30CountNumeric8500
37Count of unitsNumeric812

Limitations

The validator performs data syntax checks only and does not evaluate printed symbol quality, quiet zone dimensions, contrast, modulation or edge contrast. It cannot detect whether an FNC1 character was physically encoded in a linear barcode or whether the string will scan correctly under varying lighting conditions. Check-digit verification applies solely to GTIN and SSCC; other identifiers that may carry internal check digits are not recalculated. The tool recognises a limited set of common AIs and reports unsupported identifiers without further validation. Results assume the input string follows the element-string syntax and do not account for binary or compressed representations used in RFID tags. Additional constraints include absence of semantic validation for trade item quantities, no support for GS1 Digital Link URI syntax, and inability to verify duplicate serial numbers across multiple records.

Common mistakes

  • Operators frequently omit the leading zero in GTIN-14 strings, causing length failures.
  • Dates are often entered in DDMMYY order instead of the required YYMMDD sequence.
  • Variable-length fields such as AI 10 or AI 21 are terminated with an extra parenthesis instead of relying on the next AI or end-of-string.
  • Check digits are sometimes calculated with the wrong weighting sequence, leading to false negatives on otherwise valid GTINs.
  • Users also insert spaces or hyphens inside numeric fields, violating the numeric-only rule for fixed-length AIs.
  • AI 00 SSCC values are occasionally supplied with only 17 digits, omitting the required extension digit.
  • Alphanumeric fields receive disallowed characters such as parentheses or control codes that the validator rejects.

COMMON QUESTIONS

Frequently asked questions

How does the validator confirm the GTIN-14 check digit inside an element string?

It extracts the 14 digits after AI 01, applies the standard odd-position weighting from the right, sums the products, and verifies the result modulo 10 equals zero. Any mismatch produces a clear failure message with the expected check digit.

What date range does the tool accept for AI 17 expiration dates?

Years 00-99 are interpreted as 2000-2049 or 1950-1999 according to GS1 rules, then the month and day are validated against the Gregorian calendar. Dates such as 300229 are rejected because February never has 29 days in non-leap years.

Does the validator require an explicit FNC1 separator after every variable-length AI?

It accepts either an explicit FNC1 or the immediate start of the next AI in parentheses. When the variable field reaches its maximum length the separator is optional, matching real barcode encoder behaviour.

Can the tool detect an incorrect check digit on an 18-digit SSCC?

Yes, the same modulo-10 algorithm used for GTIN-14 is applied to the final digit of any AI 00 field. The validator reports both the supplied and the recalculated check digit for direct comparison.

What character set is permitted inside AI 10 batch or lot numbers?

Uppercase letters A-Z, digits 0-9, and the hyphen are allowed. Lowercase letters, spaces, and most punctuation characters trigger a character-set violation because they are not part of the GS1 alphanumeric subset.

How are leading zeros treated in fixed-length numeric AIs such as AI 01?

They are preserved and counted toward the exact length requirement. Removing a leading zero shortens the field and immediately fails the length check even if the remaining digits form a valid GTIN.

Does the validator handle concatenated strings that begin without a parenthesis?

It expects every AI to be enclosed in parentheses. Strings lacking the opening parenthesis are rejected before any further parsing occurs, preventing misinterpretation of the first identifier.

What happens when an unsupported AI appears in the element string?

The validator lists the unknown AI, skips length and check-digit tests for that field, and continues processing the remaining supported identifiers. No error is raised for the unsupported AI itself.