Check Digit Calculator
Verify a barcode number or work out its missing check digit. Works with UPC-A, UPC-E, EAN-13, EAN-8, GTIN-14, SSCC and ISBN-10, one code at a time or thousands at once.
Enter the full code to check it, or leave off the last digit to calculate it. Spaces and dashes are ignored.
What is a check digit?
The last digit of every UPC, EAN, GTIN and ISBN is a check digit. It is calculated from the other digits, so a scanner or a system can tell straight away when a number has been misread or mistyped. The GS1 method catches every single-digit error and most cases where two neighbouring digits are swapped.
How to calculate a UPC or EAN check digit
UPC-A, UPC-E, EAN-13, EAN-8, GTIN-14 and SSCC all use the same GS1 modulo 10 method:
- Starting from the digit just left of the check digit and moving left, multiply the digits alternately by 3 and 1.
- Add up the results.
- The check digit is the number you need to add to reach the next multiple of 10. If the sum is already a multiple of 10, the check digit is 0.
Worked example for the UPC-A 01234567890?:
| Digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Weight | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 0 | 1 | 6 | 3 | 12 | 5 | 18 | 7 | 24 | 9 | 0 |
The products add up to 85. The next multiple of 10 is 90, so the check digit is 5 and the full UPC is 012345678905. Because the weights start from the right, putting zeros in front of the number never changes the answer, which is why a UPC-A, its EAN-13 and its GTIN-14 all end in the same digit.
ISBN-10 check digits
ISBN-10 uses a different method. Multiply the first nine digits by 10, 9, 8 and so on down to 2, add them up, and pick the check digit that makes the total divisible by 11. A check value of 10 is written as X. For example, 030640615 gives a check digit of 2, so the ISBN is 0306406152. The same book's ISBN-13, 9780306406157, uses the EAN-13 method instead. You can look up either form with ISBN lookup.
UPC-E to UPC-A
UPC-E is an 8-digit, zero-suppressed form of UPC-A for small packages. To check or look it up, expand it to its 12-digit UPC-A: the sixth data digit tells you where the removed zeros go. For example, UPC-E 04252614 expands to UPC-A 042100005264. Enter a UPC-E above and the calculator shows the expanded code. It detects an 8-digit code that only checks out as a UPC-E, or you can set the format to UPC-E yourself.
Why barcodes fail validation
- Spreadsheets dropping leading zeros. Excel turns
012345678905into12345678905, which then looks like an 11-digit code with no check digit. - Scientific notation. Long codes pasted into a number column can become
5.90123E+12, and the last digits are lost for good. - Typos and swapped digits from manual entry.
- Made-up numbers that were never calculated properly in the first place.
Before you send a file to bulk barcode lookup, run it through the bulk tab above to catch broken codes. Once your codes check out, look them up one at a time with UPC lookup or in your own software with the Barcode Lookup API. If you need to print a code, the barcode generator calculates the check digit for you too.
Check Digit FAQ
Does a valid check digit mean a barcode is real?
No. The check digit only shows that the number is well formed. A made-up number has a one in ten chance of passing. To find out whether a product is recorded against the code, look it up.
Does adding a leading zero change the check digit?
No. GS1 check digits are weighted from the right, so padding a UPC-A with zeros to make an EAN-13 or GTIN-14 leaves the check digit unchanged. That is why 012345678905 and 0012345678905 are the same product.
How do I calculate a UPC-E check digit?
Expand the UPC-E to its 12-digit UPC-A form and calculate the UPC-A check digit. The UPC-E carries the same check digit. This calculator does the expansion for you.
Why does an ISBN-10 end in X?
ISBN-10 uses a modulo 11 check, so the check value can be 10. It is written as the Roman numeral X. ISBN-13 uses the same modulo 10 method as EAN-13 and never contains an X.
Why do my barcodes fail validation after opening them in Excel?
Excel stores long numbers as numbers, so it drops leading zeros and can turn 13 or more digits into scientific notation. Format the column as Text before pasting codes, or import the CSV with the column type set to Text.
Is my data sent anywhere?
No. The calculator runs entirely in your browser, so the codes you enter are never uploaded.