How the Check Digit Calculator works
Every GTIN, UPC-A, and EAN-13 barcode number ends with a check digit — a single digit computed from the digits before it, so a scanner or database can catch typos and misreads. This calculator applies GS1's official weighted-sum formula to either generate the check digit for a code that is missing one, or to validate a complete code that already has one.
The formula
Starting from the rightmost digit of the data (the digits before the check digit) and moving left, assign alternating weights of 3 and 1, beginning with 3 on the last digit. Multiply each digit by its weight and add the products together. The check digit is the value from 0 to 9 that brings that sum up to the next exact multiple of 10:
check digit = (10 − (weighted sum mod 10)) mod 10
To validate a complete code, run the same formula on all the digits except the last one, then compare the result to the last digit. If they match, the code is internally consistent; if not, it contains an error.
Worked example
Take the 11-digit UPC-A data string 04900002891. Working from the right, the digits and their alternating weights are 1×3, 9×1, 8×3, 2×1, 0×3, 0×1, 0×3, 0×1, 9×3, 4×1, 0×3, which sum to 3 + 9 + 24 + 2 + 0 + 0 + 0 + 0 + 27 + 4 + 0 = 69. Since 69 mod 10 = 9, the check digit is 10 − 9 = 1, giving the complete 12-digit UPC-A code 049000028911.
One formula, four GTIN lengths
- GTIN-8: 7 data digits + 1 check digit = 8 total, used for very small packages.
- GTIN-12 / UPC-A: 11 data digits + 1 check digit = 12 total, the standard US/Canada retail barcode.
- GTIN-13 / EAN-13: 12 data digits + 1 check digit = 13 total, the standard barcode outside North America.
- GTIN-14: 13 data digits + 1 check digit = 14 total, used on shipping cartons and cases.
The weighting rule is identical across all four — always start with weight 3 on the rightmost data digit — so the same calculation handles every standard GTIN length.
What the check digit does and does not confirm
A matching check digit confirms the code is internally consistent under the mod-10 formula — it catches the great majority of single mistyped digits and many adjacent-digit swaps. It does not confirm the code was ever assigned by GS1, corresponds to a real registered product, or is unique in any database. Treat a "valid" result as a data-integrity check, not proof that a barcode is legitimate or in use.