UPC-A barcodes
The Universal Product Code was the first barcode scanned at a supermarket checkout, in 1974. UPC-A, its standard form, has 12 digits: a number-system digit, a manufacturer number, a product number and a check digit. It is still the barcode on most products in the United States and Canada; GS1 calls the number a GTIN-12.
How it is calculated
Add the digits in the odd positions (1st, 3rd, 5th… of the first 11) and multiply by 3. Add the digits in the even positions. The check digit is what brings the total to the next multiple of 10.
Worked example
03600029145: odd positions 0 + 6 + 0 + 2 + 1 + 5 = 14, × 3 = 42; even positions 3 + 0 + 0 + 9 + 4 = 16; total 58. The next multiple of 10 is 60, so the check digit is 2: 036000291452.
Put a 0 in front of a UPC-A and you have the EAN-13 for the same product, with the same check digit.
How this works
The page removes spaces and hyphens. With 11 digits it computes the check digit with the GS1 mod-10 algorithm, weighting digits 3 and 1 alternately from the right of the payload; with 12 digits it recomputes the check digit from the first 11 and compares. The algorithm is identical to EAN-13's, so UPC and EAN check digits always agree for the same product. Everything runs in your browser.
Frequently asked
What is the difference between UPC and EAN?
UPC-A has 12 digits (US and Canada); EAN-13 has 13 (rest of the world). A UPC-A with a leading 0 is a valid EAN-13.
What does the first digit of a UPC mean?
The number system: 0, 1, 6, 7 and 8 for regular products, 2 for weighed items, 3 for medicines and 5 for coupons.
Can it check UPC-E?
Expand the 6-digit UPC-E code to its 12-digit UPC-A form first, then check it here.
Does a valid code mean the product is registered?
No. Registration is done through GS1; the check digit only catches errors.
Sources
- GS1 General Specifications — check digit calculation (§7.9)
- ISO/IEC 7812-1:2017 — Identification cards, numbering system (Luhn check digit)
- Wikipedia — Universal Product Code
Reviewed Oct 17, 2026 · test vectors fixtures/codes/upc-check-digit/