{
  "slug": "sscc-18-check-digit",
  "title": "Computing and validating an SSCC-18 check digit",
  "description": "Every carton label in an ASN carries an SSCC-18 whose last digit is a GS1 mod-10 checksum. Here is the algorithm, and the spreadsheet behaviour that silently corrupts one.",
  "keywords": [
    "sscc-18",
    "sscc check digit",
    "gs1 mod 10",
    "carton label",
    "man*gm",
    "gtin check digit"
  ],
  "cause": [
    "An SSCC-18 is 18 digits: an extension digit, a GS1 company prefix, a serial reference, and a mod-10 check digit computed from the preceding 17.",
    "The arithmetic is not the problem. The problem is that an SSCC begins with zeros, and a spreadsheet treats it as a number — dropping the leading zeros, or rendering it in scientific notation. The value that reaches the label is no longer the value that was computed, and the check digit no longer matches.",
    "The scan fails at the retailer's dock, or the ASN cites an SSCC that no carton bears. Both are chargebacks."
  ],
  "example": {
    "label": "Compute the check digit for a 17-digit payload",
    "curl": "curl -s 'https://fluentedi.com/v1/gs1/checkdigit?code=00614141123456789'",
    "output": "\"mode\": \"calculate\",\n\"payload\": \"00614141123456789\",\n\"check_digit\": 0,\n\"complete_code\": \"006141411234567890\",\n\"explanation\": \"Weighted the payload 3,1,3,1... from the right, summed,\n                then padded to the next multiple of ten.\""
  },
  "fix": [
    "Export the column as text, never as a number. If a value arrives already in scientific notation the digits are gone and cannot be recovered — re-export from the source.",
    "Validate the full 18 digits before printing labels, and again before building the ASN, so the label and the MAN*GM segment cannot disagree.",
    "The same mod-10 routine covers GTIN-14, EAN-13, UPC-12 and GTIN-8, so one check serves the whole label."
  ],
  "tools": [
    "https://fluentedi.com/v1/gs1/checkdigit",
    "https://fluentedi.com/v1/id/validate",
    "https://fluentedi.com/v1/edi/build"
  ]
}