Barcode Check Digit: How to Calculate It (Mod 10)
The check digit is the last digit of a UPC, EAN or GTIN, and it is calculated from all the digits before it. It lets a scanner or a computer catch a misread or mistyped number. The method is called mod 10 (or modulo 10), and you can do it by hand in under a minute.
The mod-10 algorithm for a UPC-A
A UPC-A has 11 data digits followed by one check digit. To calculate it:
- Write down the 11 digits and number their positions 1 to 11 from the left.
- Add the digits in the odd positions (1, 3, 5, 7, 9, 11).
- Multiply that sum by 3.
- Add the digits in the even positions (2, 4, 6, 8, 10).
- Add the results of steps 3 and 4.
- Find the amount needed to reach the next multiple of 10. That amount is the check digit. If the total is already a multiple of 10, the check digit is 0.
Worked example
Take the data digits 03600029145.
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Digit | 0 | 3 | 6 | 0 | 0 | 0 | 2 | 9 | 1 | 4 | 5 |
Odd positions: 0 + 6 + 0 + 2 + 1 + 5 = 14. Multiply by 3: 14 x 3 = 42.
Even positions (2, 4, 6, 8, 10) hold 3, 0, 0, 9 and 4. Their sum is 3 + 0 + 0 + 9 + 4 = 16.
Add: 42 + 16 = 58. The next multiple of 10 is 60, and 60 minus 58 is 2.
The check digit is 2, so the full UPC is 036000291452.
Verifying a full number
To check a complete 12-digit code, run the same steps on all 12 digits, giving the odd positions (1, 3, ... 11) a weight of 3 and the even positions (2, 4, ... 12) a weight of 1. If the total is a multiple of 10, the number is valid. For 036000291452: odd positions 0, 6, 0, 2, 1, 5 sum to 14, times 3 is 42. Even positions 3, 0, 0, 9, 4, 2 sum to 18. The total is 60, a multiple of 10, so the code is valid.
EAN-13 uses the same idea
For EAN-13 you take 12 data digits and the weights alternate 1, 3, 1, 3 starting from the left, so the first digit gets weight 1. Take 400638133393:
- Positions 1, 3, 5, 7, 9, 11 (weight 1): 4 + 0 + 3 + 1 + 3 + 9 = 20.
- Positions 2, 4, 6, 8, 10, 12 (weight 3): 0 + 6 + 8 + 3 + 3 + 3 = 23, times 3 is 69.
- Total: 89. The next multiple of 10 is 90, so the check digit is 1.
The EAN-13 is 4006381333931. This works because a UPC-A is an EAN-13 with a leading zero; the extra zero shifts which positions are weighted by 3 and gives the same answer.
What the check digit catches
Mod 10 catches every single-digit error and most swaps of two adjacent digits. It does not catch every possible error, which is why scanners also verify the bars themselves. It is a safety net, not a guarantee that a number belongs to a real product.
Note that a valid check digit only means the math works. It does not mean the number was issued to you. Only GS1 can assign a UPC that retailers and marketplaces will recognize.
Skip the arithmetic
You do not have to calculate this by hand. The UPC barcode generator and EAN-13 generator compute the check digit when you enter one fewer digit, and flag a wrong one when you enter the full number. For a long list, the bulk barcode generator validates every row. Barcode Ready runs in your browser, so the numbers stay on your device.
Checklist
- Count positions from the left.
- UPC-A: odd positions times 3, even positions times 1.
- Round the total up to a multiple of 10; the difference is the check digit.
- A valid full code sums to a multiple of 10.
- Keep spreadsheet columns formatted as text so leading zeros are not lost.