A check digit is the final number in a GTIN barcode. It exists to catch common data-entry errors—transposed digits, single-digit mistakes, and some double errors—before bad data enters a supply chain. Without it, a mistyped product code might point to the wrong item, cause a pricing error, or fail at a retail point-of-sale.
This article covers how check digits are calculated for the main GTIN formats, why the math works, and how to verify them without doing the arithmetic by hand.
Where check digits appear
Every GS1 GTIN includes a check digit in the rightmost position:
| GTIN type | Total digits | Check digit position | Common use |
|---|---|---|---|
| GTIN-8 | 8 | 8th | Small retail items (EAN-8) |
| GTIN-12 | 12 | 12th | North American retail (UPC-A) |
| GTIN-13 | 13 | 13th | Global retail (EAN-13) |
| GTIN-14 | 14 | 14th | Cases and logistics units (ITF-14) |
ISBN-13 and ISSN are also GTIN-13s and use the same algorithm. Legacy ISBN-10 used a different modulo-11 system, but modern book barcodes are ISBN-13.
The GS1 check-digit algorithm
The algorithm is a weighted sum modulo 10. For any GTIN, you:
- Start from the right (excluding the check digit itself) and move left.
- Multiply each digit alternately by 3 and by 1. The digit immediately left of the check digit always gets multiplied by 3.
- Sum all products.
- Find the nearest equal or higher multiple of 10, then subtract the sum. The difference is the check digit. If the sum is already a multiple of 10, the check digit is 0.
This is sometimes called the “modulo 10 algorithm” or “Luhn-like” approach, though GS1’s weighting pattern (3-1-3-1…) is specific to GTINs.
Worked example: GTIN-13 629104150021C
Digits left to right: 6 2 9 1 0 4 1 5 0 0 2 1 C (C = check digit to find)
| Position from right | Digit | Multiplier | Product |
|---|---|---|---|
| 2 | 1 | 3 | 3 |
| 3 | 2 | 1 | 2 |
| 4 | 0 | 3 | 0 |
| 5 | 0 | 1 | 0 |
| 6 | 5 | 3 | 15 |
| 7 | 1 | 1 | 1 |
| 8 | 4 | 3 | 12 |
| 9 | 0 | 1 | 0 |
| 10 | 1 | 3 | 3 |
| 11 | 9 | 1 | 9 |
| 12 | 2 | 3 | 6 |
| 13 | 6 | 1 | 6 |
Sum of products: 3 + 2 + 0 + 0 + 15 + 1 + 12 + 0 + 3 + 9 + 6 + 6 = 57
Nearest equal or higher multiple of 10 is 60.
Check digit = 60 − 57 = 3
Complete GTIN-13: 6291041500213
GTIN-12 and GTIN-14 behave identically
The algorithm does not change for shorter or longer GTINs. For GTIN-12, you simply have fewer digits to multiply. For GTIN-14, the leading digit (often a packaging level indicator, 1–8) is treated like any other digit in the weighted sum.
Why the weights 3 and 1?
The 3/1 weighting catches the two most common human transcription errors:
- Single-digit errors (e.g., typing 7 instead of 2): any difference is multiplied by 1 or 3, so the sum changes and the check digit fails.
- Adjacent transpositions (e.g., typing 58 instead of 85): because 3×5 + 1×8 = 23 differs from 3×8 + 1×5 = 29, the error is detected.
It does not catch every possible error—some transpositions of digits differing by 5, when one is in a ×3 position, can slip through—but it catches roughly 90% of typical keyboard or scanner misreads.
Verifying an existing GTIN
To verify, include the check digit in the calculation. The total weighted sum including the check digit must be a multiple of 10.
Using the completed GTIN-13 above:
| Position from right | Digit | Multiplier | Product |
|---|---|---|---|
| 1 (check digit) | 3 | 1 | 3 |
| 2 | 1 | 3 | 3 |
| … | … | … | … |
The full sum becomes 57 + 3 = 60, which is divisible by 10. The GTIN is valid.
Tools and calculators
Manual calculation is useful for understanding the mechanism, but in practice most people use a validator or embed the logic in software.
- GTIN Validator — accepts GTIN-8 through GTIN-14 and shows whether the check digit is correct, with the underlying math displayed.
- GS1 Global Check Digit Calculator — official reference from GS1 headquarters.
- GS1 US Check Digit Calculator — regional variant with additional guidance.
If you are building the check into your own system, the algorithm can be implemented in a few lines of code in any programming language. GS1 publishes the specification in the GTIN standard.
Common pitfalls
| Problem | Cause | Fix |
|---|---|---|
| Check digit fails after manual entry | Transposed digits or arithmetic error | Re-enter from source; use a validator |
| GTIN-14 check digit wrong | Treating the indicator digit as “not part of the number” | Include all 13 preceding digits in the calculation |
| ISBN-10 confusion | Older books use ISBN-10 (modulo 11) | Convert to ISBN-13 first, or use ISBN-13 barcode |
| Scanner reads but POS rejects | Check digit correct, but prefix not in retailer’s database | Verify GTIN ownership and retailer registration |
Relationship to GTIN structure
The check digit is only one part of a GTIN. The full number also contains a company prefix (assigned by GS1 or carried via a reseller allocation) and an item reference chosen by the brand owner. The check digit protects the integrity of the entire string, but it does not validate who owns the prefix or whether the GTIN is registered in any database.
Summary
- Every GTIN-8, GTIN-12, GTIN-13, and GTIN-14 ends in a check digit computed by a 3/1 weighted sum modulo 10.
- The algorithm is identical across all lengths; only the number of digits changes.
- The check digit catches most single-digit and transposition errors but does not guarantee the GTIN is correctly allocated or active in retailer systems.
- For quick verification, use a dedicated tool rather than manual calculation.
For businesses sourcing GTINs through International Barcodes Network members, the check digit is typically pre-calculated and included in the numbers provided. Always validate before printing, especially if you are generating barcode artwork in-house or converting between GTIN lengths.