Barcode Education
Check Digit Algorithm
How barcodes detect scanning errors
What is a Check Digit?
A check digit is a form of redundancy check used to detect errors in identification numbers. It is the final digit in any UPC-A, EAN-13, or GTIN code, calculated from all preceding digits. If a scanner misreads one digit, the check digit calculation fails — and the scanner knows to try again.
UPC-A / EAN-13 Algorithm (Luhn-like)
Example: Calculate check digit for 036000291452 (12 digits)
Step 1: Take the first 11 digits: 0 3 6 0 0 0 2 9 1 4 5
Step 2: Multiply odd positions (1,3,5,7,9,11) by 1: 0,6,0,2,1,5 → sum=14
Step 3: Multiply even positions (2,4,6,8,10) by 3: 3,0,0,9,4 → sum=48
Step 4: Total = 14 + 48 = 62
Step 5: Check digit = (10 - (62 % 10)) % 10 = (10 - 2) % 10 = 8
Full UPC: 036000291452 ✓
Verify Any UPC
Enter any UPC on upc.dev to instantly verify the check digit, identify the GS1 prefix, and pull full product intelligence.
Related Articles