UPC and GTIN check digit explained

September 2026

That last digit on a barcode is not decoration. It is a checksum. If someone types 03600029145 instead of 036000291452, the check digit fails and the scanner (or your inventory system) can catch it before you ship the wrong SKU.

Prefer a calculator over mental math? Use the barcode check digit calculator.

What the check digit protects

Retail codes like UPC-A (12 digits) and EAN-13 / GTIN-13 (13 digits) encode company and item data, then append one check digit. The formula is public on purpose. Security is not the goal. Typo detection is.

UPC-A formula (worked example)

Take the first 11 digits: 03600029145.

  • Odd positions (1, 3, 5…): 0+6+0+2+1+5 = 14, then ×3 = 42
  • Even positions (2, 4, 6…): 3+0+0+9+4 = 16
  • Total: 42 + 16 = 58
  • Next multiple of 10 is 60, so check digit = 2

Full code: 036000291452. Change any earlier digit and that final 2 usually stops matching.

EAN-13 / GTIN-13

Same idea with 12 data digits and one check digit. Weighting still alternates, starting with weight 1 or 3 depending on length conventions in your GS1 docs. In practice, paste the code into the calculator and pick the matching format rather than memorizing every edge case.

When you need this

Printing labels

Generating barcodes without a valid check digit produces symbols that look fine and fail at checkout.

Cleaning product spreadsheets

Excel sheets full of UPCs often lose leading zeros or drop the check digit. Validation finds the broken rows fast.

Debugging scanner rejects

If a code “looks right” but will not scan, check digit mismatch is near the top of the suspect list.

Related tools

Check digit FAQ

Back to Learn

Related tools