What the check digit does
Retail barcodes and ISBNs end with a check digit calculated from the other digits. A scanner recomputes it on every read: if it does not match, the code is rejected. It catches all single-digit errors and most swaps of two adjacent digits.
EAN-13, ISBN-13 and UPC-A
- Number the digits from the left.
- EAN-13 / ISBN-13: multiply the 1st, 3rd, 5th… digits by 1 and the 2nd, 4th, 6th… by 3. UPC-A: multiply the 1st, 3rd, 5th… by 3 and the others by 1.
- Add everything up.
- The check digit is what brings the total to the next multiple of 10: (10 − sum mod 10) mod 10.
Example: for 4 0 0 6 3 8 1 3 3 3 9 3, the weighted sum is 89, so the check digit is 1 and the full code is 4006381333931.
A UPC-A code is an EAN-13 with a leading 0, so both methods give the same check digit. For 03600029145 the check digit is 2.
EAN-8
The seven digits are weighted 3, 1, 3, 1, 3, 1, 3. For 7351353 the check digit is 7.
ISBN-10
Older book numbers use a different rule: multiply the digits by 1, 2, 3… 9, add them up, and take the remainder modulo 11. A remainder of 10 is written as X. For 0-306-40615 the check digit is 2. ISBN-13 replaced ISBN-10 in 2007 by adding the prefix 978 and recomputing the check digit with the EAN method.
Prefixes
The first digits of an EAN-13 identify the GS1 organization that issued the company number, not necessarily the country of manufacture:
| Prefix | Meaning |
|---|---|
| 000–139 | Mostly GS1 US (some ranges for in-store use and coupons) |
| 300–379 | GS1 France |
| 400–440 | GS1 Germany |
| 978–979 | Books (ISBN) |
Getting real barcodes
To sell products in stores you need company prefixes licensed from GS1 US (or your country’s GS1). Codes you make up may collide with other products. Entering leading zeros is optional: the calculator treats a shorter number as if it started with zeros.