GTIN fundamentals

How to Calculate a GTIN Check Digit

A GTIN check digit is the final digit of the identifier. It is calculated from the digits before it using the GS1 modulo-10 algorithm, giving scanners and software a fast way to catch many transcription errors.

Published 2026-09-216 min read

The GS1 modulo-10 algorithm

  1. Exclude the check digit position.

    Start with the 7, 11, 12 or 13 data digits that will precede the final digit.

  2. Work from the right.

    Multiply the rightmost data digit by 3, the next digit by 1, and continue alternating 3 and 1 as you move left.

  3. Add the products.

    The result is the weighted sum of all data digits.

  4. Move to the next multiple of ten.

    Subtract the sum from the nearest equal or higher multiple of ten. The difference, from 0 to 9, is the check digit.

A compact formula is (10 − (sum mod 10)) mod 10. The final modulo handles the case where the sum is already a multiple of ten, producing a check digit of zero.

Worked example: data digits 629104150021

This GTIN-13 example is published by GS1 and was separately recomputed for this guide rather than being taken from ProductPassKit’s implementation.

Digit629104150021
Weight131313131313
Product66930121150023
  1. The weighted products total 57.
  2. The next multiple of ten is 60.
  3. 60 − 57 = 3, so the check digit is 3.
  4. The complete GTIN-13 is 6291041500213.

How to verify the result

Append the calculated digit, then validate the complete GTIN. A validator should report both the detected format and the expected check digit. If it fails, first check the direction of the alternating weights: the rightmost data digit is weighted by 3.

You can also repeat the arithmetic independently in a spreadsheet or another trusted calculator. Independent verification is especially useful before identifiers are loaded into packaging, catalogue or master-data systems.

A correct check digit is not an assigned GTIN

The algorithm checks internal consistency only. It does not issue an identifier, confirm a GS1 licence, identify an owner or establish that the number belongs to a particular product. Keep mathematical validation separate from registry and governance checks.

Sources and standards

Technical statements in this guide are grounded in current GS1 primary sources. The explanations are paraphrased for practical use.