How this calculator works
Select the complete identifier length and enter the data digits for generation, or all digits for validation. The optional leading-zero count adds zeros before the data string. Working from the rightmost data digit, multiply alternately by 3 and 1. Add the products and choose the digit that reaches the next multiple of ten. The table keeps digit positions visible. All codes remain text, so zeros are preserved.
Formula
Weighted sum = sum(data digit x alternating weight 3, 1, starting at the right). Check digit = (10 - (weighted sum mod 10)) mod 10. Append that single digit to the data string.
Worked example
For data 400638133393, the weighted sum is 89, so the check digit is 1 and the complete GTIN is 4006381333931. Data 03600029145 has sum 58, giving check digit 2 and complete UPC 036000291452.
Advertisement
Frequently asked questions
Does a valid check digit prove the product is registered?
No. It checks the arithmetic structure only. GS1 registration and ownership must be checked separately.
Can this validate ISBN or payment cards?
This tool applies the GS1 modulo-ten weighting used for GTINs. Other identifiers may use another length, weighting or algorithm.
Should leading zeros be removed?
Keep them. Choose the intended GTIN length and preserve its data string. The leading-zero option adds zeros only when generating a code.