Guide
How to check whether a barcode (GTIN) is valid
GTIN-8, GTIN-12 (UPC-A), GTIN-13 (EAN-13) and GTIN-14 all end in a check digit computed from the digits before it. A mistyped or truncated barcode usually fails this check.
The rule
- Write the digits without the last one. Starting from the digit next to the check digit and moving left, alternate weights 3, 1, 3, 1, …
- Multiply and add everything up.
- The check digit is the amount needed to reach the next multiple of 10 (0 if already a multiple).
Worked example: 4006381333931
Digits before the last: 4 0 0 6 3 8 1 3 3 3 9 3. From the right the weights are 3,1,3,1…: 3×3 + 9×1 + 3×3 + 3×1 + 3×3 + 1×1 + 8×3 + 3×1 + 6×3 + 0×1 + 0×3 + 4×1 = 9+9+9+3+9+1+24+3+18+0+0+4 = 89. The next multiple of 10 is 90, so the check digit is 1, which matches the final digit. The barcode is valid.
Second example: 5012345678900
Following the same steps gives a check digit of 0, matching the final digit, so it is valid. Change any single digit and the check will almost always fail.
What a pass does and does not prove
- A valid check digit means the number is well-formed.
- It does not prove the barcode belongs to this product, or is registered at all.
Also look for the same barcode on two different products, and for spreadsheet damage such as scientific notation (4.00638E+12) or lost leading zeros. The free tool checks check digits and duplicates in your browser; your file is not uploaded.