Quick answer
UPC-A contains 11 data digits and a final modulo-10 check digit. Add three times the digits in odd positions among the first 11, add the even-position digits, and choose the digit that makes the total divisible by ten.
How to do it
- Keep the 11-digit body as text so leading zeros remain.
- Apply the alternating 3 and 1 weights.
- Calculate the final digit and compare it with the scanned or supplied UPC.
UPC-A and EAN-13
A UPC-A can often be represented as an EAN-13 by adding a leading zero, but the business systems and printed conventions may differ. Do not add or remove digits casually when a retailer specifies an exact format.
Use the check digit correctly
The checksum helps catch common entry errors; it does not create a legitimate product identifier. The company prefix and item reference must come from an authorized numbering process. Store the value as a string in databases and CSV files.
Common mistakes to avoid
- Letting spreadsheet software convert the UPC to a number.
- Including spaces in the checksum calculation.
- Generating arbitrary retail codes for products.
Try the related tool
Use QRFoundry directly in your browser. Tool inputs and uploaded files are processed on your device.
Open UPC-A Generator & Validator