This page 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.
A check digit is the final number in a GTIN barcode. It exists to catch common data-entry errors such as transposed digits, single-digit mistakes, and some double errors, all 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.
Check digits also help scanner devices recognize when they have incorrectly scanned a barcode. After a scanner reads a barcode it will recalculate the check digit based on the digits it read and compare the calculated check digit against the barcode’s check digit. When a mismatch between the calculated check digit and the barcode’s check digit occurs the scanner knows a scan error has occurred.
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 (International Standard Book Number) and ISSN (International Standard Serial Number) numbers used on books are technically special cases of GTIN-13s, and thus 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.
The checksum scheme cannot catch every possible error. Some transpositions of digits can slip past the check, when differing by 5 and when one is in a ×3 position, the resulting checksum digit will be the same. Still, the checksum check digit helps catch the vast majority of typical keyboard or scanner misreads.
Verifying an existing GTIN by hand
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 6291041500213:
| Position from right | Digit | Multiplier | Product |
|---|---|---|---|
| 1 (check digit) | 3 | 1 | 3 |
| 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 |
Weighted Sum (without check digit) = 3+2+0+0+15+1+12+0+3+9+6+6 = 57
The full sum becomes 57 + 3 = 60, which is divisible by 10. The GTIN is valid.
Note that the weighted sum multiplier for the check digit is always 1.
Tools and calculators
Manual verification of check digits is useful for understanding the mechanism, but is not practical at scale. 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 — GS1’s check digit calculator.
- GS1 US Check Digit Calculator — US regional variant with additional guidance.
If you are building GTIN check digit validation into your own system, the algorithm can be implemented in a few lines of code in any programming language. GS1 publishes the formal spec in their general specification document, under the ‘Check digit/character calculations’ section.
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 scan errors and single-digit and transposition errors but does not guarantee the GTIN has been allocated for use nor does it indicate whether the GTIN is active in retailer systems.
- Use a dedicated tool rather than manual calculation when cerifying checksums.
Any reputable barcode supplier, such as members of the International Barcodes Network, will include the check digit as part of the GTINs they supply. When generating your own barcode artwork, always validate before printing.