Download GTIN checksumming fixtures
These files are text-based, self-contained and reusable in automated tests. They contain 30 synthetic records created by ProductPassKit—not product registrations or GTIN allocation records.
Download GTIN test vectors (JSON) · Download GTIN test vectors (CSV)
Permanent URLs: /datasets/gtin-validation-test-vectors.json and /datasets/gtin-validation-test-vectors.csv. Link directly to this guide for the test descriptions and limitations.
Coverage: valid, invalid and malformed identifiers
The dataset includes three positive examples and three check-digit mismatch examples for each of the four GTIN formats (24 rows), plus six edge cases. That covers GTIN-8, GTIN-12, GTIN-13, GTIN-14, nonnumeric input, unsupported lengths, empty input, accepted separators and a leading-zero UPC case.
| Example | Expected result | Use it to test |
|---|---|---|
96385074 | GTIN-8, structurally valid | Length and check digit |
96385075 | GTIN-8, checksum mismatch | Expected digit 4 |
036000291452 | GTIN-12, structurally valid | Preserving leading zeroes |
4006381333931 | GTIN-13, structurally valid | Normalization to 04006381333931 |
4006381333932 | GTIN-13, checksum mismatch | Expected digit 1 |
How to use the vectors in automated tests
- Read the JSON
vectorsarray, or import the CSV as text to preserve leading zeroes. - For each input, compare your result with
expected_valid,expected_type,expected_check_digitandexpected_gtin14. - For negative cases, ensure your validation rejects the input without asserting identifier ownership.
- Run an independent standards-aligned implementation to verify arithmetic rather than blindly trusting one code path.
The field reason provides the expected diagnostic category. expected_gtin14 is null for invalid examples. expected_check_digit can also be null where no supported numeric format was detected.
Do not confuse a padded representation with a new GTIN-14
For GTINs shorter than 14 digits, leading filler zeroes can be added for fixed-length fields. A padded GTIN-12 remains the same GTIN-12 identity represented in a 14-character field. It is not newly allocated as a packaging-level GTIN-14.
CSV readers should import identifiers as strings. Spreadsheet numeric conversion can strip leading zeros before the validator even receives the original identifier.
Limitations and appropriate use
All provided numbers are synthetic test cases and must not be used as real product identifiers. Arithmetic success does not establish GS1 issuance, licensing, company ownership, assignment or barcode print quality. This dataset is a regression-testing aid, not a certification suite or substitute for the normative GS1 specification.
To explore an input interactively, use the single GTIN validator, or upload the CSV to the bulk GTIN checker.
Sources and standards
Technical statements in this guide are grounded in current GS1 primary sources. The explanations are paraphrased for practical use.
- GS1 General SpecificationsNormative GS1 rules for GTIN structures and modulo-10 check-digit calculations.
- GS1 Check Digit CalculatorAuthoritative check-digit reference for validating an algorithm independently.
- GS1: Communicating trade item numbersOfficial rules for 14-character representations of shorter GTIN values.