The Serial Shipping Container Code (SSCC) is an 18-digit GS1 identifier used in logistics to uniquely identify a physical shipping unit — a pallet, box, roll cage, or any other logistic unit. It is the primary identifier used in supply chain transactions between trading partners.
SSCCs appear in two main contexts:
GIN+BJThe SSCC is always accompanied by the Application Identifier (AI) 00, which signals to any GS1-compliant system that what follows is an SSCC.
An SSCC has exactly 18 digits, structured as follows:
| AI | Extension | GS1 Company Prefix | Serial Reference | Check Digit | |
| (00) | 3 | 56012345 | 00000001 | 6 | |
| not stored | 1 digit | 7–10 digits | variable | 1 digit | |
(00) for SSCCs. Not part of the 18 digits — it is a label that precedes them.560 may ship goods manufactured anywhere in the world.
The SSCC check digit uses the standard GS1 Modulo-10 algorithm. Given the 17-digit body:
(10 − (sum mod 10)) mod 10Body: 35601234500000001
| Position (from right) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Digit | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 4 | 3 | 2 | 1 | 0 | 6 | 5 | 3 |
| Multiplier | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 4 | 9 | 2 | 3 | 0 | 18 | 5 | 9 |
| Sum = 68 → Check digit = (10 − (68 mod 10)) mod 10 = (10 − 8) mod 10 = 2 | |||||||||||||||||
Full SSCC: (00) 35601234500000001 2
(sum + check_digit) mod 10 === 0, the SSCC is valid. This is the fastest way to validate an existing 18-digit SSCC.
The AI (00) is a label, not part of the 18 digits. When a barcode is scanned with a GS1-128 reader, the raw output is often 00 followed by the 18 digits — giving 20 characters total. Always strip the leading 00 before validating the check digit.
An SSCC body is always exactly 17 digits (before the check digit) or 18 digits (including it). Numbers with 19, 20 or more digits are either GTINs, IBANs, or other identifiers — not SSCCs.
Some ERP systems store SSCCs in fixed-width fields padded with leading zeros. A 20-character field starting with 00 followed by an 18-digit SSCC, or a 21-character field where the last character is a line number — always extract exactly 18 digits for the SSCC.
The GS1 prefix (first 3 digits of the SSCC after the extension digit) identifies the GS1 member organisation that issued the company prefix — not the country where the goods were made or shipped from. A company registered in Portugal (560) may ship from a warehouse in Spain.
Here is a complete, dependency-free JavaScript implementation for validating and generating SSCC check digits. It uses BigInt to safely handle the large numbers involved.
/**
* Calculate the GS1 check digit for a 17-digit SSCC body.
* @param {string} body17 - 17-digit string (no check digit)
* @returns {number} check digit (0-9)
*/
function getCheckDigit(body17) {
let sum = 0;
const digits = body17.split('').reverse();
for (let i = 0; i < digits.length; i++) {
sum += parseInt(digits[i]) * (i % 2 === 0 ? 3 : 1);
}
return (10 - (sum % 10)) % 10;
}
/**
* Validate an 18-digit SSCC string.
* @param {string} sscc18 - 18-digit SSCC (without AI prefix)
* @returns {{ valid: boolean, expected: number, provided: number }}
*/
function validateSSCC(sscc18) {
const digits = sscc18.replace(/\D/g, '');
if (digits.length !== 18) throw new Error('SSCC must be 18 digits');
const body = digits.substring(0, 17);
const provided = parseInt(digits[17]);
const expected = getCheckDigit(body);
return { valid: provided === expected, expected, provided };
}
/**
* Normalise any SSCC input to an 18-digit string.
* Handles: 17 digits (generates CD), 18 digits, 20 digits with AI "00".
*/
function normaliseSSCC(raw) {
const d = raw.replace(/\D/g, '');
if (d.length === 17) return d + getCheckDigit(d);
if (d.length === 18) return d;
if (d.length === 20 && d.startsWith('00')) return d.substring(2);
throw new Error(`Unexpected length: ${d.length}`);
}
// Examples
validateSSCC('356012345000000012'); // { valid: true, expected: 2, provided: 2 }
validateSSCC('356012345000000019'); // { valid: false, expected: 2, provided: 9 }
normaliseSSCC('00356012345000000012'); // '356012345000000012' (strips AI)
normaliseSSCC('35601234500000001'); // '356012345000000012' (generates CD)
In EDIFACT messages, SSCCs appear in several segments. The most common is GIN with qualifier BJ (Goods Identity Number, SSCC), used in DESADV (Despatch Advice) and IFTMIN (Forwarding Instruction).
| Segment | Description | Example |
|---|---|---|
| GIN+BJ:<SSCC> | Primary SSCC segment in DESADV / IFTMIN | GIN+BJ:356012345000000012' |
| RFF+SI:<SSCC> | Reference, qualifier SI = Shipment ID | RFF+SI:356012345000000012' |
| RFF+AAK:<SSCC> | Reference, qualifier AAK = Despatch number | RFF+AAK:356012345000000012' |
| PAC | Package segment — SSCC sometimes embedded | PAC+1++09:356012345000000012' |
/**
* Extract all SSCCs from an EDIFACT message string.
* Handles custom UNA delimiters.
*/
function extractSSCCsFromEDIFACT(text) {
const ssccList = [];
// Read custom delimiters from UNA service string
let compSep = ':', elemSep = '+', segTerm = "'";
const una = text.match(/^UNA(.{6})/);
if (una) {
compSep = una[1][0];
elemSep = una[1][1];
segTerm = una[1][5];
}
const segments = text
.replace(/\r?\n/g, '')
.split(segTerm)
.map(s => s.trim())
.filter(Boolean);
for (const seg of segments) {
const parts = seg.split(elemSep);
if (parts[0] !== 'GIN') continue;
for (const el of parts.slice(1)) {
const [qualifier, value] = el.split(compSep);
if (qualifier === 'BJ' && value) {
const result = validateSSCC(value);
ssccList.push({ sscc: value, ...result });
}
}
}
return ssccList;
}
: + ' will silently fail on non-standard files.
If you need to validate SSCCs without writing code, SSCC Pro Vision is a free, open-source tool that runs entirely in the browser. No installation, no backend, no data leaves your device.
Free, open-source SSCC validator and check digit calculator — runs entirely in your browser.
Open Validator →