Skip to content

VOC005: GTIN Checksum

Severity: Error Category: Vocabulary Validation

Description

GTIN (Global Trade Item Number) must have a valid check digit.

Rule Details

This rule validates GTIN checksums using the GS1 check digit algorithm. GTINs are found in product IDs, either as plain numbers or embedded in GS1 Digital Links.

Supported formats:

  • GTIN-8: 8 digits
  • GTIN-12: 12 digits (UPC-A)
  • GTIN-13: 13 digits (EAN-13)
  • GTIN-14: 14 digits

Example

Invalid

{
  "credentialSubject": {
    "product": {
      "id": "https://id.gs1.org/01/12345678901235"
    }
  }
}

Message: Invalid GTIN checksum in '12345678901235'

Valid

{
  "credentialSubject": {
    "product": {
      "id": "https://id.gs1.org/01/00614141123452"
    }
  }
}

Check Digit Algorithm

The GS1 check digit is calculated as:

  1. Sum digits in odd positions (from right, excluding check digit)
  2. Sum digits in even positions, multiply by 3
  3. Add both sums
  4. Check digit = (10 - (sum mod 10)) mod 10

How to Fix

  1. Verify the GTIN is entered correctly
  2. Use a GS1 check digit calculator
  3. Contact your GS1 member organization if issues persist

References