a strip of digits, read from the right

Check digit calculator

Type the digits of a GTIN-8, GTIN-12 (UPC-A), GTIN-13 (EAN-13) or GTIN-14. Leave off the last digit to find it, or type the whole number to verify it. Every step of the sum is shown.

What do you have?

Spaces and hyphens between groups are fine, for example 0 12345 67890.

Result

Choose what you have, pick the number type, type the digits and press Calculate.

How the check digit is worked out

Every GTIN ends in a check digit calculated from the digits before it, so a scanner or a program can catch a mistyped or misread number.

check digit = (10 − (sum mod 10)) mod 10

  • Start at the rightmost digit before the check digit. Multiply it by 3, the next digit to its left by 1, the next by 3, and so on, alternating to the first digit.
  • Add the products to get the sum. "sum mod 10" is the remainder after dividing by 10.
  • Because the weights are counted from the right, zeros added on the left do not change the check digit. That is why the padded 13 and 14 digit forms below keep the same last digit.
  • Example: 01234567890 gives a sum of 85, 85 mod 10 is 5, and (10 − 5) mod 10 = 5, so the full UPC-A number is 012345678905.

The tool only does this arithmetic on the digits you type. It is not a lookup: a correct check digit does not show that a number was issued to any product, so treat the result as an estimate until the number's owner confirms it. Nothing you type leaves your browser.

Leading zeros: a spreadsheet cell formatted as a number drops them, so 012345678905 becomes 12345678905. Format the column as text before you scan or paste into it.

Method: GS1 General Specifications, the section on check digit calculation, published by GS1. See the GS1 General Specifications and GS1's own Check Digit Calculator.