Barcode Ready
← Barcode Guides

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:

  1. Write down the 11 digits and number their positions 1 to 11 from the left.
  2. Add the digits in the odd positions (1, 3, 5, 7, 9, 11).
  3. Multiply that sum by 3.
  4. Add the digits in the even positions (2, 4, 6, 8, 10).
  5. Add the results of steps 3 and 4.
  6. 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.

Position1234567891011
Digit03600029145

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:

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

Try it