What this EAN check digit calculator does
Retail barcodes on packages, books and outer cases end with a check digit computed by the GS1 modulo-10 rule. EAN-13, EAN-8, UPC-A and GTIN-14 all share that rule. This calculator takes the digits you already have, detects the symbology from the length, and either computes the missing check digit or tells you whether the last digit is correct. Every weighting step is shown, with the running sum and the remainder, so you can audit a number a supplier sent before you print a label.
The GS1 prefix of the finished number is looked up against the common membership ranges. A prefix names the organisation that issued the company prefix. It is not the country where the product was made, filled or packed. Nothing you type is uploaded. The arithmetic runs in the page, which makes it safe to check draft GTINs and numbers copied from a damaged label.
How the check digit is calculated
GS1 uses one rule for GTIN-8, GTIN-12, GTIN-13 and GTIN-14. If the code is already complete, drop the final digit. Walk the remaining digits from the right. The digit immediately left of the check position is multiplied by 3, the next by 1, then 3, then 1, alternating to the left. Add the products. The check digit is what brings that sum up to the next multiple of 10. If the sum already ends in 0, the check digit is 0: check = (10 − (sum mod 10)) mod 10.
The body 400638133393 is a worked EAN-13. From the right the weights begin 3, 1, 3, 1, so the final 3 is multiplied by 3. The weighted sum is 69. 69 mod 10 is 9, and 10 − 9 = 1. The full EAN-13 is 4006381333931. Validating a complete code repeats that arithmetic on every digit except the last and compares the result.
Length picks the reading:
- 7 digits calculate an EAN-8 / GTIN-8. 8 digits validate one.
- 11 digits calculate a UPC-A / GTIN-12. A finished UPC-A has 12 digits.
- 12 digits are read first as an EAN-13 body, so a check digit is appended. The same 12 digits are also a complete UPC-A, shown as an alternate reading.
- 13 digits validate an EAN-13. They can also be a GTIN-14 still missing its check digit, with the first digit as the packaging indicator.
- 14 digits validate a GTIN-14, the number usually printed as ITF-14 on a carton.
Prefixes, and how to use the result
The first three digits of a GTIN-13, or the three digits after a GTIN-14 indicator, are the GS1 prefix. 400–440 is GS1 Germany, much of 000–139 is GS1 US, 500–509 is GS1 UK, 690–699 is GS1 China and 300–379 is GS1 France. A company licensed in one country can manufacture elsewhere and keep its prefix. Ranges 020–029 and 200–299 are restricted in-store numbers. 977 is ISSN, 978–979 is ISBN, and 980–999 covers refunds and coupons. Variable-measure items encode a price or weight in the middle digits; change those digits and you must recompute the check digit.
UPC-A written as GTIN-13 gains a leading zero. That zero does not change the check digit, because it adds nothing to the weighted sum.
Paste digits with or without spaces. Read the detected type, the check digit and the full number, then copy it. For a complete code, the status line says whether the last digit matches. The weighting table lists each digit, its weight of 1 or 3, and the product. Generate barcode draws the symbol. Barcode types explained compares EAN-13, EAN-8, UPC-A and ITF-14.
A correct check digit does not mean GS1 issued the number to you. Retailers reject unlicensed company prefixes. ISBN-13 validates here; the older ISBN-10 check digit, which can be the letter X, does not. On ITF-14 the indicator is covered by the check digit, so moving a unit GTIN onto a carton without recomputing the fourteenth digit will not scan. Twelve digits are an EAN-13 body first and a finished UPC-A second: if you meant the UPC, use the alternate line.