What Is a Barcode Check Digit? How It Works
A barcode check digit is a calculated number that catches scanning and typing errors. Learn how it works, the EAN-13 formula, and why it matters most.
Scan a product at checkout and the barcode either works or it doesn't. Behind that instant pass-or-fail sits a small piece of arithmetic called the check digit, a single number that quietly verifies every other digit in the barcode is correct. It's easy to overlook, but it's the reason mismatched or mistyped barcodes get rejected instead of silently corrupting a database.
What Is a Barcode Check Digit?
A barcode check digit is the final digit in a numeric barcode, calculated from all the digits before it using a fixed mathematical formula. Scanners and databases recalculate this digit from the scanned data and compare it to the printed one, rejecting the read if the two don't match.
Every common retail and logistics barcode built on the GS1 numbering system, including UPC-A, EAN-13, EAN-8, ITF-14, and GS1-128's SSCC and GTIN fields, ends with one of these digits. It isn't part of the product identifier itself. A 12-digit UPC-A only actually identifies a product with its first 11 digits; the 12th exists purely to validate the other 11. Strip it off and the barcode still displays the same number visually, but any system that checks it will flag the code as invalid.
How Is the Barcode Check Digit Calculated?
Most GS1 barcodes use a modulo 10 formula: multiply alternating digits by 3 and 1, add the results together, and find how far that sum is from the next multiple of 10. That difference is the check digit, and the same calculation runs again every time the barcode is scanned.
Working through a real UPC-A code makes the process concrete. Take 036000291452, the 12-digit UPC for a well-known pack of chewing gum. Drop the last digit and work with the first 11: 0, 3, 6, 0, 0, 0, 2, 9, 1, 4, 5.
- Sum the odd-position digits (1st, 3rd, 5th, and so on) and multiply by 3. Here that's 0+6+0+2+1+5 = 14, and 14 x 3 = 42.
- Sum the even-position digits as they are. That's 3+0+0+9+4 = 16.
- Add the two totals together. 42 + 16 = 58.
- Find the next multiple of 10 and subtract. The next multiple of 10 above 58 is 60, so 60 - 58 = 2.
The check digit is 2, which matches the final digit of 036000291452. A scanner performs this exact sequence in milliseconds every time it reads a barcode, comparing its result to the printed check digit before accepting the scan.
What Is the Check Digit Formula for EAN-13?
For EAN-13, multiply the digits in odd positions (from the left, excluding the check digit) by 1 and the digits in even positions by 3, add everything together, then subtract the result's remainder when divided by 10 from 10. UPC-A and GTIN-14 use the same formula with the weighting reversed to fit their digit count.
The reversal is just a matter of how many digits precede the check digit; an EAN-13 has 12 digits before its check digit (an even count), while a UPC-A has 11 (an odd count), so the weighting pattern of 3s and 1s lines up differently when counted from the left. GTIN-14, used on shipping cartons and cases, follows the same odd/even logic as EAN-13 but with two extra leading digits for packaging level and indicator. Because the underlying math is identical, a barcode generator or GS1 member organization's check digit calculator can apply the same routine across UPC-A, EAN-13, EAN-8, ITF-14, and GTIN formats; only the digit count and weighting order change.
Why Do Barcodes Need a Check Digit?
Check digits catch the two most common sources of bad data: a scanner misreading a damaged or poorly printed barcode, and a person mistyping a number by hand. Without one, a single flipped digit could silently route a shipment to the wrong warehouse or ring up the wrong price at checkout.
The modulo 10 formula used across GS1 barcodes is specifically good at catching the errors that actually happen in practice. It detects every single-digit substitution error, meaning if just one digit is wrong, the check digit will not match. It also catches the large majority of transposition errors, where two adjacent digits get swapped, since swapping digits with different position weights almost always changes the calculated result. That combination covers the two mistakes that dominate real-world barcode and data-entry failures.
This matters beyond a single failed scan at the register. A barcode number that passes into inventory, shipping, or point-of-sale systems without validation can create a mismatch that isn't caught until a shipment arrives at the wrong distribution center or a customer is charged for the wrong item. Rejecting a bad read immediately, at the point of scanning, is far cheaper than untangling the downstream consequences later.
Which Barcode Types Use a Check Digit?
Every numeric GS1 symbology, including UPC-A, UPC-E, EAN-13, EAN-8, ITF-14, and the GTIN and SSCC fields inside GS1-128, carries a mandatory modulo 10 check digit as part of its official structure. ISBNs printed as EAN-13 barcodes follow the identical rule.
Alphanumeric symbologies handle validation differently. Code 128 and Code 39 can include an optional check character, but it isn't required by the symbology itself and many implementations skip it, relying instead on the barcode's built-in start/stop patterns and encoding redundancy for error detection. Code 128 in particular has strong inherent error detection from its encoding scheme even without a check character. QR codes and other 2D symbols use a completely different approach: Reed-Solomon error correction, which can reconstruct missing or damaged data rather than just flagging it as invalid. For a deeper look at how that encoding works across formats, see our guide to how barcodes work.
How Do I Verify a Check Digit Without Software?
Working the modulo 10 formula by hand, as shown above, takes under a minute for any GS1 barcode and is a useful way to spot-check a suspicious code before it goes to print. In practice, though, nearly everyone relies on automated tools since manual verification doesn't scale past a handful of codes.
Any EAN-13 or UPC-A generator calculates the check digit automatically the moment you enter the preceding digits, so there's rarely a reason to compute one by hand outside of learning how the system works or auditing a small batch of codes. If you're building or troubleshooting barcodes for your own products, our UPC-A guide and GS1-128 guide cover check digit placement within each format's full structure. You can also confirm any printed barcode is reading correctly by scanning it with a free online barcode scanner and checking that the decoded number looks right.
Sources
- Wikipedia: International Article Number (EAN) - check digit algorithm and error detection coverage for EAN/GTIN barcodes.
- Wikipedia: Check digit - general explanation of check digit systems and modulo-based validation.
- GS1 Canada: Check Digit Calculator - GS1 member organization reference tool for GTIN check digit calculation.
- UPCGen: UPC Check Digit Calculator, Formula, and Worked Example - worked UPC-A check digit example and formula breakdown.