
Barcode BasicsBarcode Basics
Do Barcodes Set Off Store Alarms?
Learn what store security gates detect, how a barcode scan can be connected to tag deactivation, and what to do if an alarm sounds.
Calculate a UPC check digit by hand or with GS1's calculator, check a worked example, and learn what to do when the digits do not match.

A UPC check digit is the final digit of a UPC-A’s 12-digit GTIN-12. It is calculated from the first 11 digits and helps detect errors in the number. To verify one, recalculate the check digit from those first 11 digits and compare it with the last digit. A match checks the number’s mathematical composition; it does not prove that the number belongs to a product or that the product is genuine. [1][2]
Read the complete 12-digit number, including any small digits printed outside the main group of bars. Keep leading zeros. The final, rightmost digit is the check digit; the preceding 11 digits are the input to the calculation. If you are copying from a scanner or spreadsheet, compare the whole value with the label or the issuer’s original record before proceeding.
For this guide, the example is the GTIN-12 012345000058, published by GS1 as an example of data carried in UPC-A. Its first 11 digits are 01234500005, and its last digit is 8. [3]
Use the 11 digits before the check digit. For UPC-A, count positions from the left, starting with position 1: [2]
For 01234500005:
| Calculation | Result |
|---|---|
| Positions 1, 3, 5, 7, 9, 11: 0 + 2 + 4 + 0 + 0 + 5 | 11 |
| Multiply by 3 | 33 |
| Positions 2, 4, 6, 8, 10: 1 + 3 + 5 + 0 + 0 | 9 |
| Total: 33 + 9 | 42 |
| Next multiple of 10: 50; 50 − 42 | 8 |
The calculated digit matches the last digit in 012345000058. It is an illustration of the calculation, not a claim that this number is assigned to your product.
For the example above, entering 01234500005 returns 8. If the displayed result differs from the last digit on your source, review the whole number before changing anything. The calculator produces the digit for the input you give it; it cannot tell which digit was mistyped.
Do not replace the last digit just to make an existing product’s number pass. First determine the complete number assigned to that product from an authoritative source.
GS1 uses the same alternating weights for GTIN-8, GTIN-12, GTIN-13, and GTIN-14: working from the rightmost data digit, multiply by 3, then 1, alternating as you move left. Add the products and take the difference to the next equal or higher multiple of 10. Use 7, 11, 12, or 13 data digits respectively, excluding the final check digit. Starting from the right avoids applying the UPC-A left-position pattern unchanged to a different length. [2]
This guide covers GS1 GTIN check digits. Other identifiers and barcode symbologies can use different rules; identify the number before applying a formula.
[1] GS1. Check digit calculator. https://www.gs1.org/services/check-digit-calculator
[2] GS1. How to calculate a check digit manually. https://www.gs1.org/services/how-calculate-check-digit-manually
[3] GS1. 2D Barcodes at Retail Point-of-Sale Implementation Guideline, release 1.1, section 4. https://ref.gs1.org/guidelines/2d-in-retail/1.1.0/
[4] Google Merchant Center Help. How to fix: Invalid GTIN in unsupported format. https://support.google.com/merchants/answer/12158484?hl=en