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 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 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:

  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.

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 rightDigitMultiplierProduct
1 (check digit)313
2133

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.

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

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 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.