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 typeTotal digitsCheck digit positionCommon use
GTIN-888thSmall retail items (EAN-8)
GTIN-121212thNorth American retail (UPC-A)
GTIN-131313thGlobal retail (EAN-13)
GTIN-141414thCases 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:

  1. Start from the right (excluding the check digit itself) and move left.
  2. Multiply each digit alternately by 3 and by 1. The digit immediately left of the check digit always gets multiplied by 3.
  3. Sum all products.
  4. 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 rightDigitMultiplierProduct
2133
3212
4030
5010
65315
7111
84312
9010
10133
11919
12236
13616

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 rightDigitMultiplierProduct
1 (check digit)313
2133
3212
4030
5010
65315
7111
84312
9010
10133
11919
12236
13616

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.

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

ProblemCauseFix
Check digit fails after manual entryTransposed digits or arithmetic errorRe-enter from source; use a validator
GTIN-14 check digit wrongTreating the indicator digit as “not part of the number”Include all 13 preceding digits in the calculation
ISBN-10 confusionOlder books use ISBN-10 (modulo 11)Convert to ISBN-13 first, or use ISBN-13 barcode
Scanner reads but POS rejectsCheck digit correct, but prefix not in retailer’s databaseVerify 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.