How to Calculate a Barcode Check Digit (EAN, UPC, ITF-14)

By QRizeo team · Published 11 October 2026 · 5 min read

The last digit of every EAN, UPC and ITF-14 barcode is a check digit. It is calculated from the other digits, so a scanner can tell immediately if the number was misread or mistyped.

The method (GS1 modulo 10)

  • Take all digits except the check digit.
  • Starting from the right, multiply the digits alternately by 3 and 1 (rightmost × 3).
  • Add up all the results.
  • Subtract the total from the next multiple of 10. The result (0–9) is the check digit.

Example: EAN-13

Number without check digit: 590123412345.

From the right: 5×3, 4×1, 3×3, 2×1, 1×3, 4×1, 3×3, 2×1, 1×3, 0×1, 9×3, 5×1 = 15 + 4 + 9 + 2 + 3 + 4 + 9 + 2 + 3 + 0 + 27 + 5 = 83.

Next multiple of 10 is 90. 90 − 83 = 7. Full number: 5901234123457.

Example: UPC-A

Number without check digit: 03600029145.

From the right: 5×3, 4×1, 1×3, 9×1, 2×3, 0×1, 0×3, 0×1, 6×3, 3×1, 0×3 = 15 + 4 + 3 + 9 + 6 + 0 + 0 + 0 + 18 + 3 + 0 = 58.

60 − 58 = 2. Full number: 036000291452.

Example: ITF-14

Number without check digit: 1540014128876. Applying the same weights from the right gives a total of 97. 100 − 97 = 3, so the full GTIN-14 is 15400141288763.

Spreadsheet formula

For a 12-digit EAN body in cell A1 (stored as text), this Google Sheets / Excel formula returns the check digit:

=MOD(10-MOD(SUMPRODUCT(MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12},1)*{1,3,1,3,1,3,1,3,1,3,1,3}),10),10)

For other lengths, make sure the 3 weight lands on the rightmost digit.

What the check digit catches

Every single wrong digit, and most cases where two neighbouring digits are swapped. It does not prove the number was issued to you; only GS1’s records do that.