How to Use the Check Digit Calculator
Type the number without its check digit to get that digit. Type the full number to test it. Spaces and hyphens are ignored.
| What you have | Digits to add | Full length |
|---|---|---|
| UPC-A | 11 | 12 |
| EAN-13 | 12 | 13 |
| EAN-8 | 7 | 8 |
| GTIN-14 | 13 | 14 |
The tool can’t tell a short number from a long one that’s missing digits, so pick the type first. The method is the same one used on the main UPC page.
How the Check Digit Is Calculated
Start at the right end of the digits you have. Give the first one a weight of 3, the next a weight of 1, and keep alternating to the left. Multiply, add everything, then count up to the next multiple of ten. That gap is the check digit. A total that already ends in zero gives 0.
Worked example
For the UPC digits 01234500005, the weighted digits add to 42. The next multiple of ten is 50, so the check digit is 8 and the full number is 012345000058.
GS1’s own example for a longer number is 629104150021. Its total is 57, so the check digit is 3.
Mistakes a Check Digit Catches and Misses
A single wrong digit always changes the result, so it is always caught. A swap of two neighbors is caught unless the pair differs by exactly 5. These swaps pass unnoticed: 0 and 5, 1 and 6, 2 and 7, 3 and 8, 4 and 9.
A passing number can still be the wrong one. The check says nothing about who owns it or which product it belongs to.
Check Digits in a Spreadsheet
For 11 digits stored as text in cell A1, this formula returns the UPC check digit:
=MOD(10-MOD(SUMPRODUCT(--MID(A1,{1,3,5,7,9,11},1))*3+SUMPRODUCT(--MID(A1,{2,4,6,8,10},1)),10),10)
Format the column as text before you paste numbers. Otherwise a leading zero disappears and every position shifts. Test the formula with 01234500005, which should return 8.
Have a whole list? You can make barcodes in bulk and get each check digit added. For short packs, see how to convert UPC-A to UPC-E.
Examples for Each Length
These four examples run through the same weights. You can type each one into the tool to see its steps.
| Type | Digits without check | Weighted total | Check digit | Full number |
|---|---|---|---|---|
| EAN-8 | 9638507 | 86 | 4 | 96385074 |
| UPC-A | 01234500005 | 42 | 8 | 012345000058 |
| EAN-13 | 629104150021 | 57 | 3 | 6291041500213 |
| GTIN-14 | 1001234500005 | 45 | 5 | 10012345000055 |
Why the Weights Start From the Right
The rightmost data digit always gets a weight of 3. Counting from that end keeps the method the same for every length. Counting from the left only works if you know how long the number is. That is why a UPC starts with 3 on its first digit, while a 12-digit EAN-13 body starts with 1.
It also means that adding zeros to the front changes nothing. A UPC written as a 14-digit GTIN with two leading zeros keeps its check digit, because each added zero contributes nothing to the total. A case number with an indicator from 1 to 9 is different. That digit counts, so the check digit has to be worked out again.
Testing a List Before You Print
Check numbers before they reach packaging, not after.
- Keep the master list as text, so leading zeros survive.
- Test each full number, either here or with the spreadsheet formula below.
- Investigate every failure at its source. Don’t just replace the last digit.
- Confirm that each passing number is assigned to the product you think it is.
Step 3 matters most. If a digit in the middle is wrong, swapping in a new check digit gives you a number that passes the test and still points to the wrong item.
Check Digit FAQs
How is a UPC check digit calculated?
Multiply the digits in odd positions by 3 and in even positions by 1, add them, and subtract the total from the next multiple of ten.
Why doesn’t my check digit match?
One digit is probably mistyped, two neighbors are swapped, or a leading zero was lost. Compare the number with your original record.
Which errors can a check digit miss?
It misses neighbor swaps where the two digits differ by 5. It also can’t detect a valid number that belongs to a different product.
Does the same method work for EAN-13 and GTIN-14?
Yes. Count the weights from the right, starting with 3, and the method works for each of these lengths.
Why did my leading zero vanish?
A spreadsheet treated the code as a number. Set the column to text and enter it again.
Should I fix a failed number by changing the last digit?
Only if you know the other digits are right. Compare the whole number with your record first.