What is a check digit?
A check digit is the final digit of a barcode number. It is not arbitrary - it is calculated from all the other digits using a fixed algorithm. When a scanner reads a barcode, it recalculates what the check digit should be based on the digits it scanned, then compares that value to the digit it actually read. If they match, the scan is accepted. If they do not match, the scanner rejects the reading as a likely mis-scan.
This is a simple but effective error-detection mechanism. Most mis-scans produce a single wrong digit, and a wrong digit almost always produces a wrong check digit calculation, which the scanner catches.
Which barcode formats use check digits?
The GS1 barcode family - EAN-13, UPC-A, EAN-8, ISBN-13, and GTIN-14 - all use the same check digit algorithm. This consistency is intentional: it allows a single scanner to validate barcodes from any GS1 format.
Code 128 and Code 39 also have check digit mechanisms, though they are optional in Code 39 and use different algorithms.
The GS1 check digit algorithm
The GS1 modulo-10 algorithm works as follows:
- Take all the digits except the check digit (the last digit).
- Assign alternating weights of 1 and 3 to each digit, starting from the rightmost digit (position 1 from the right gets weight 3, position 2 gets weight 1, position 3 gets weight 3, and so on).
- Multiply each digit by its weight and sum all the results.
- Divide the sum by 10. The check digit is 10 minus the remainder. If the remainder is 0, the check digit is 0.
Example with EAN-13 base: 400638133393
| Position from right | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |---|---|---|---|---|---|---|---|---|---|---|---|---| | Digit | 4 | 0 | 0 | 6 | 3 | 8 | 1 | 3 | 3 | 3 | 9 | 3 | | Weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | | Product | 4 | 0 | 0 | 18 | 3 | 24 | 1 | 9 | 3 | 9 | 9 | 9 |
Sum: 4+0+0+18+3+24+1+9+3+9+9+9 = 89
Remainder: 89 mod 10 = 9
Check digit: 10 - 9 = 1
Full EAN-13: 4006381333931
Validating a check digit without software
If you have a 13-digit EAN-13 number and want to verify it is correct:
- Separate the last digit (the check digit).
- Apply the algorithm to the first 12 digits.
- Compare the calculated check digit to the last digit. If they match, the number is valid.
Using the check digit checker tool
The barcode check digit checker on this site handles this automatically. Enter your barcode number, select the format (EAN-13, UPC-A, EAN-8, ISBN-13, or GTIN-14), and the tool tells you:
- If you entered a full number (13 digits for EAN-13): it validates the check digit and shows you whether it is correct.
- If you entered the base number without the check digit (12 digits for EAN-13): it calculates and displays the correct check digit.
The tool also shows the step-by-step calculation so you can verify the working.
Common scenarios where this matters
Transcription errors. You have a product number written on paper, but you are not sure if it was copied correctly. Enter it into the checker to verify the check digit is consistent with the other digits.
Database validation. You have a spreadsheet of product barcodes imported from a supplier. Running them through check digit validation catches any that were entered with a typo.
Building a barcode from a product reference. You have a 12-digit base number and need the complete 13-digit EAN-13. The checker calculates the check digit for you.
Verifying a barcode you are about to print. If you are generating your own barcodes using a GS1 company prefix, verify the check digit is correct before committing to a print run. A barcode with a wrong check digit will be rejected by every scanner that validates it. You can generate and preview a finished barcode using the EAN-13 barcode generator or the UPC-A barcode generator once you have confirmed the number is valid.
When a correct check digit does not mean the barcode is registered
A valid check digit means the number is structurally correct. It does not mean the number is registered with GS1, assigned to a real product, or recognised by any retailer's product database. Those are separate systems entirely.
A barcode generated with an arbitrary number will pass check digit validation and will scan correctly - it will just return "unknown product" in any retailer database that looks up the product by barcode.