GS1 DATA TOOL
GS1 test element-string generator
Create clearly marked synthetic records without reusing a real product or logistics identifier in development fixtures.
Inputs
Results
Run the sample to see decoded fields and checks.
ON THIS DEVICE
Recent history
RULES USED
Method and formulas
Random data digits are generated locally with cryptographic browser randomness where available, then valid Modulo-10 check digits are appended.
Generated identifiers are fictional and unallocated. Never place them on products or logistics units entering a real supply chain.
GUIDE
What this tool does and when to use it
The GS1 test element-string generator produces checksum-valid fictional identifiers for GTIN and SSCC together with optional lot, serial and date fields. It supports scanner and parser testing by emitting properly formatted element strings that begin with Application Identifiers such as (01) for GTIN-14, (00) for SSCC, (10) for batch or lot, (21) for serial, (17) for expiry date and (15) for best-before date. Testers select the number of samples and the scope of fields, after which the browser generates random digits locally and appends correct Modulo-10 check digits. The resulting strings are suitable for validating barcode parsers, label-printing workflows and data-exchange routines without risking real supply-chain identifiers. Because all values remain unallocated, they must never appear on physical products or logistics units that enter commerce.
Developers integrate the generator into automated test suites by calling its JavaScript functions directly from unit-test frameworks. Quality-assurance teams use the output to populate sample databases that exercise every branch of an inbound EDI parser. Because generation occurs entirely client-side, no network calls are required and test data never leaves the local browser session.
Worked example with realistic numbers
Selecting five samples with the full field set yields element strings such as (01)09501101543218(17)260331(10)AB7842K(21)SN392 8471. A second sample might read (00)345678901234567899(17)250615(10)LOTX9921(21)SER881002. The table below shows five complete outputs with their component parts separated for clarity.
| Sample | GTIN-14 element | SSCC element | Expiry (17) | Lot (10) | Serial (21) |
|---|---|---|---|---|---|
| 1 | (01)09501101543218 | (00)345678901234567899 | 260331 | AB7842K | SN3928471 |
| 2 | (01)05012345678901 | (00)012345678901234567 | 250615 | LOTX9921 | SER881002 |
| 3 | (01)07654321098765 | (00)987654321098765432 | 270228 | BATCH44 | SRV102938 |
| 4 | (01)00345678901234 | (00)456789012345678901 | 241231 | PROD778 | SEQ445566 |
| 5 | (01)08432109876543 | (00)321098765432109876 | 260430 | RUN991 | ID773311 |
Second worked example: SSCC-only batch
Choosing the include=sscc option with ten samples produces purely logistics-unit identifiers. One resulting string is (00)123456789012345678. The generator still applies the Modulo-10 check digit to the preceding seventeen digits, ensuring the full eighteen-character element string passes any standard checksum routine. This mode is ideal when testing warehouse-management systems that only scan SSCC labels on pallets.
Formula and method table
| Input parameter | Accepted values | Processing step | Output component |
|---|---|---|---|
| count | 1-50 | Generate n random digit strings | Requested number of element strings |
| include=full | GTIN-14 + dates + lot + serial | Append Modulo-10 check digit to 13 digits | (01)xxxxxxxxxxxxxc(17)YYMMDD(10)alphanum(21)alphanum |
| include=sscc | SSCC-18 only | Append Modulo-10 check digit to 17 digits | (00)xxxxxxxxxxxxxxxxxc |
| include=gtin | GTIN-14 only | Append Modulo-10 check digit to 13 digits | (01)xxxxxxxxxxxxxc |
Units and conversions notes
| Field | Length | Character set | Checksum rule | Typical use case |
|---|---|---|---|---|
| GTIN-14 | 14 | 0-9 | Modulo-10 on first 13 digits | Trade-item identification |
| SSCC-18 | 18 | 0-9 | Modulo-10 on first 17 digits | Logistics-unit tracking |
| Expiry (17) | 6 | YYMMDD | None | Regulatory compliance |
| Best-before (15) | 6 | YYMMDD | None | Retail shelf-life |
| Lot (10) | 1-20 | Alphanumeric | None | Batch traceability |
| Serial (21) | 1-20 | Alphanumeric | None | Instance-level tracking |
GTIN-14 uses 14 digits where the final digit is the Modulo-10 check digit calculated from the preceding 13 digits. SSCC-18 follows the same checksum rule on 17 preceding digits. Date fields follow the GS1 YYMMDD format; the year is interpreted as 2000-2099. Lot and serial fields accept alphanumeric characters up to 20 characters each, although the generator limits them to eight characters for readability during testing. No unit conversion occurs because all outputs remain pure identifier strings; however, users must ensure that any downstream system interprets the Application Identifiers correctly before numeric or date parsing begins.
Limitations
- Generated values are fictional and carry no registration with GS1.
- The tool never produces GTIN-8 or GTIN-12 formats.
- Randomness relies on the browser crypto API when available, otherwise falling back to Math.random.
- Element strings do not include FNC1 characters required by some linear symbologies.
- Maximum sample count is capped at 50 to prevent excessive output size.
- No validation against existing GS1 company prefixes is performed.
- Output length may exceed scanner buffer limits when all optional fields are enabled simultaneously.
- The generator does not simulate variable-length numeric compression used in GS1 DataMatrix.
Common mistakes
- Users sometimes copy generated strings directly onto production labels, violating the unallocated-data rule.
- Another frequent error is omitting the leading zero in the (01) or (00) prefix when manually constructing test barcodes.
- Date fields are occasionally entered in MMDDYY order instead of the required YYMMDD sequence, causing parser failures.
- Testers may neglect to verify that their scanner configuration recognizes the full set of Application Identifiers present in the full-field output.
- Developers forget to strip parentheses before feeding strings into certain legacy middleware that expects only the numeric AI value.
- Some users assume the generated serial numbers are globally unique across multiple test runs, leading to duplicate-key errors in database imports.
- Teams overlook that the tool never enforces GS1 company-prefix length rules, so manually created prefixes may fail real-world validation later.
COMMON QUESTIONS
Frequently asked questions
How is the Modulo-10 check digit computed for a 13-digit GTIN-14 prefix inside the generator?
The generator sums alternating digits starting from the right, multiplies the result by 3 or 1 according to position, then subtracts the total from the next multiple of 10 to obtain the check digit that is appended as the fourteenth character.
What is the maximum length allowed for the lot number field when full element strings are requested?
The generator restricts lot numbers to eight alphanumeric characters to keep test strings compact while still exercising typical parser length handling for AI (10).
Does the tool ever emit real GS1 company prefixes that could collide with allocated ranges?
No, every prefix is drawn from reserved test blocks that GS1 has explicitly marked as unallocated, eliminating any risk of real-world identifier collision.
Which Application Identifier appears first when both GTIN-14 and SSCC-18 are produced in a single sample?
The generator always places the (01) GTIN element before the (00) SSCC element within the same output line so that parsers encounter the primary trade item identifier first.
Can the generated expiry dates fall on 29 February in non-leap years?
The date routine avoids 29 February in non-leap years by checking the year modulo 4 before emitting YYMMDD values, ensuring all dates remain calendar-valid.
What happens to serial numbers when the include option is set to SSCC only?
Serial fields are omitted entirely when SSCC only is chosen, because SSCC already encodes the full logistics-unit identifier and additional serial data would be redundant for that test scope.
How many random digits are drawn before the check digit is appended for an SSCC-18 element string?
Exactly seventeen random digits are generated; the eighteenth digit is then calculated via the Modulo-10 algorithm and appended to complete the SSCC element string.
Are the produced element strings guaranteed to pass GS1 syntax validation suites that enforce FNC1 separators?
The strings contain correct AI sequences but lack explicit FNC1 characters, so they pass numeric and date parsing tests yet require additional symbology-layer configuration when used with linear barcodes.