GTIN, serial number & check digit: the format rules
Behind every battery passport QR code sits an identifier that follows exact rules: fixed character lengths, a defined character set and a check digit that exposes typing errors. This guide explains the rules, works through the check-digit calculation step by step and shows, on a concrete example, exactly where an invalid serial number fails.
- Two numbers, two rule sets. The GTIN identifies the model and consists of 8, 12, 13 or 14 digits. The serial number identifies the individual battery and may be 1 to 20 characters long.
- The last GTIN digit is computed, not counted. The modulo-10 check digit makes mistyped or transposed digits visible immediately - and it is the most common reason an import gets rejected.
- The character set is narrower than expected. CSET 82 contains neither spaces nor umlauts. "BPW 2027#Ü01" is not a valid serial number; "BPW-2027-UE01" is.
- Batteriepasswerk checks both on save - in the database, not just in the form. The same rules therefore apply to the input mask, the CSV import and the API.
Why the format is a legal question
Format rules sound like a detail for the IT department. For the battery identifier they are not: it is the only anchor by which a passport will still be found years later.
Article 77(3) of Regulation (EU) 2023/1542 requires the QR code and the unique identifier to conform to the ISO/IEC 15459 series. That series does not prescribe a specific number - it requires the identifier to come from an accredited issuing agency and to be globally unique. GS1 is such an agency. A serialised GTIN - the combination of the model number and the serial number of the individual battery - therefore satisfies the requirement, as long as three conditions hold:
One of the four permitted lengths, digits only, and a correct check digit in the final position.
At most 20 characters, exclusively from the GS1 character set CSET 82 - otherwise the value cannot travel as AI 21.
The combination of GTIN and serial number must exist exactly once worldwide - otherwise one scan points to two batteries.
The difference between "scannable" and "conformant"
A QR code carrying any URL will scan and display a page - that is not enough. What is required is an identifier from a recognised numbering system that a recycler's system or a market surveillance authority can resolve by machine, without knowing the individual manufacturer's convention. This is precisely where the improvised QR code parts ways with a conformant identifier.
How the identifier sits inside the QR code
The GS1 Digital Link packs both numbers into an ordinary URL. The short numbers between the slashes are application identifiers (AIs): they tell the reading system what the value behind them means.
| Component | Meaning | Format rule |
|---|---|---|
| AI 01 | GTIN - identifies the model (the trade item) | Always 14 digits in a Digital Link - GTIN-8/12/13 padded with leading zeros |
| AI 21 | Serial number - identifies the individual battery | 1-20 characters from CSET 82, case-sensitive |
| AI 01 + AI 21 | Serialised GTIN - the identifier under ISO/IEC 15459 | Combination globally unique |
How the QR code itself must be designed - contrast, size, durability - is covered in QR codes on batteries from 2027.
Four permitted GTIN lengths - and no fifth
GS1 issues numbers in exactly four lengths. Which one a company uses depends on the product and the target market - not on its internal numbering habits.
| Format | Length | Typical use | Note |
|---|---|---|---|
| GTIN-8 | 8 digits | Very small items where no longer code fits on the label | Rare in the battery sector |
| GTIN-12 | 12 digits | North American UPC format | Relevant when exporting to the US and Canada |
| GTIN-13 | 13 digits | The EAN format common in Europe - the default case | German prefixes usually start 400-440 |
| GTIN-14 | 14 digits | Outer cases and trade units, leading indicator digit | The required form inside a Digital Link (GS1 DL 1.4.0+) |
Inside a Digital Link the GTIN is always 14 digits
All four formats are padded to 14 digits for a Digital Link: GTIN-13 4006381333931 becomes 04006381333931. The check digit does not change, because the weighting starts from the right and a leading zero contributes nothing to the sum. Since version 1.4.0 of the GS1 Digital Link URI syntax (current 1.6.0, March 2025) this is no longer a recommendation but a requirement: new implementations must express the GTIN as 14 digits, and only existing resolvers should keep accepting the shorter legacy forms. In spreadsheets the leading zero only survives if the column is formatted as text.
The last digit does arithmetic
The check digit is not a running number but the result of a calculation across all preceding positions. It costs one position and in return catches the two most common capture errors: the mistyped digit and the transposed pair.
- Weighted sum
- 89
- Next multiple of ten
- 90
- Expected check digit
- 90 − 89 = 1
- Supplied
- 1
Valid GTIN - accepted
- Weighted sum
- 89
- Next multiple of ten
- 90
- Expected check digit
- 90 − 89 = 1
- Supplied
- 2
Check digit does not match - the save is rejected
The method is identical for all four GTIN lengths and is called modulo 10 with 3/1 weighting. It detects every single mistyped digit value - a 7 instead of a 1 necessarily changes the weighted sum. For transposed neighbouring digits it works almost always; the one gap is pairs whose values differ by exactly 5 (16 instead of 61, for instance). Ruling that out requires a second check against your own item master.
Check digits are calculated, not incremented
The classic mistake when creating new models: take the previous model's GTIN and add one. The base part is then correct, but the check digit only happens to fit in one case out of ten. New GTINs come from your own GS1 number range, and the check digit is computed by the system.
CSET 82: 82 characters, no more
Unlike the GTIN, a serial number may contain letters - but not arbitrary ones. The GS1 character set CSET 82 covers exactly 82 characters, and anything outside it cannot travel as an AI 21 value.
| Group | Characters | Count |
|---|---|---|
| Upper-case letters | A-Z | 26 |
| Lower-case letters | a-z | 26 |
| Digits | 0-9 | 10 |
| Special characters | ! " % & ' ( ) * + , - . / : ; < = > ? _ | 20 |
| Not included | Space, # $ @ [ \ ] ^ ` { | } ~, umlauts, accents, all non-ASCII characters | - |
Two details are regularly missed. First, case is significant: BPW-0001a and BPW-0001A are two different serial numbers. Treating them as one in the warehouse creates mix-ups that are formally not mix-ups at all. Second, some permitted characters - /, ?, &, %, + - are also control characters in URLs. They are valid as a serial number but must be escaped inside a Digital Link, otherwise the browser splits the address in the wrong place. As long as the software handles that, it is a non-issue; in a hand-written link it is a real one.
Valid and invalid side by side
Both serial numbers below come from the same internal scheme and look equally usable. Only the left one can be encoded as a GS1 identifier - the right one fails on three individual characters.
- Length14 of 20 characters
- Character set GS1 CSET 82all characters allowed
- Unique per companyfree
- Length12 of 20 characters
- Character set GS1 CSET 823 disallowed characters
- Unique per companyfree
- Space. CSET 82 contains no space character - inside a path segment it would only travel escaped (%20) anyway.
- The character # is not part of CSET 82. In a URL it also starts the fragment, so a scan would cut the identifier short.
- Umlauts and every other non-ASCII character are disallowed - CSET 82 covers only A-Z, a-z, 0-9 and 20 special characters.
The fix: BPW 2027#Ü01 becomes BPW-2027-UE01 - same meaning, encodable character set.
Six errors that show up in real imports
| Error | What happens | What helps |
|---|---|---|
| Leading zero disappears | Spreadsheets read the GTIN as a number. 04006381333931 becomes 4006381333931 - or worse, 4.00638E+12. | Format the column as text before importing; never store a GTIN as a numeric value. |
| Umlauts in the serial number | Ü, ä, é or ß are not part of CSET 82 and cannot be encoded as an AI 21 value. | Switch to A-Z, a-z, 0-9 and the 20 permitted special characters (Ü → UE). |
| Spaces as separators | "BPW 2027 0001" looks tidy but is not a valid AI 21 value - CSET 82 has no space character. | Use a hyphen or a full stop; both are part of the character set. |
| Internal number too long | ERP serial numbers often run to 24 or 32 characters. From character 21 the identifier is no longer AI 21 conformant. | Define a shortened derivation and verify its uniqueness - do not truncate blindly. |
| Check digit guessed | Continuing a GTIN by hand eventually produces a number whose last digit no longer fits. | Always let the system compute the check digit; never carry it forward. |
| GTIN used twice | Two models sharing a GTIN make resolution ambiguous - the scan cannot tell which passport to show. | Exactly one model per GTIN. Variants need their own GTINs. |
Where the rules are enforced in our product
Format rules that are only checked in the input form no longer apply to a CSV import or an API call. That is why our validation sits one level deeper - in the database, behind every write path.
Without a GTIN there is a fallback link - but no GS1 identifier
Models without a GTIN get a fallback address pointing at the internal passport ID. The QR code scans and the passport is publicly reachable - but that is not enough for Article 77(3), because the identifier then comes from no accredited numbering system. Shipping a conformant passport requires a GS1 number on the model. The QR page flags this during generation so the gap does not slip through to production.
How one model turns into thousands of serialised passports is covered in Creating a battery passport. Which data fields are mandatory beyond that is covered in What data goes into the battery passport.
Frequent questions on GTIN and serial numbers
How many digits does a GTIN have?
How do you calculate the GS1 check digit?
Which characters are allowed in a GS1 serial number?
Why is a serial number limited to 20 characters?
What happens if the GTIN or serial number is not conformant?
Sources & further reading
GTIN and serial number are validated on save - not first discovered at the scan
Batteriepasswerk validates length, character set and check digit in the database and turns them into a GS1 Digital Link QR code per unit - conformant to EU 2023/1542 and DIN DKE SPEC 99100, hosted in the EU.