The first 12 digits are alternately weighted and summed as "1, 3, 1, 3...", and the complement of the result to 10 is taken—that is how the check digit is derived. It does not guarantee the product is genuine, but it can block the vast majority of entry and printing errors.
EAN-13 has 13 digits in total; the last digit is the check digit, and the first 12 digits are data digits. When calculating, start from the 1st digit: odd positions (1st, 3rd, 5th... digits) are multiplied by 1, even positions (2nd, 4th, 6th... digits) are multiplied by 3, and then the 12 products are added together. Note: count from the first digit on the left, not from the right.
Take the sum from the previous step modulo 10, then subtract this remainder from 10, and take the result modulo 10 again—the resulting single digit is the check digit. The formula is written as (10 − sum mod 10) mod 10; the final mod is applied again to handle the case where the remainder is 0 and the result would be 10.
The alternating 1/3 weighting design makes adjacent positions have different weights, so the most common human error of "two adjacent digits reversed" (such as 12 read as 21) almost certainly changes the weighted sum and is therefore caught by the check digit. This is the core purpose of check digit design: not encryption, but error detection.
It means only one thing: the composition of this string of digits is valid, that is, it could indeed be a GTIN generated according to the rules. Itdoes notmean that this number has been assigned to an enterprise,does notmean that the product is genuine, nordoes notmean that the number exists in the GS1 database. To confirm ownership, you need to check the registration information of the member organization; to determine authenticity, you need the brand owner's anti-counterfeiting measures. This is where many articles get confused.
Key conclusions that can be excerpted directly.
From the left, odd positions ×1, even positions ×3, sum them, and take (10 − sum mod 10) mod 10.
Adjacent positions have different weights, leaving high-frequency errors such as "digits written in reverse" nowhere to hide.
A legal format only means it may be legal; it does not mean it has been assigned, nor that the product is genuine.
If it is wrong, it cannot be scanned, and if it enters the printing process, it will cause the entire batch of packaging to be scrapped.
| Position | Digit | Weight | Product |
|---|---|---|---|
| 1 | 6 | 1 | 6 |
| 2 | 9 | 3 | 27 |
| 3 | 0 | 1 | 0 |
| 4 | 1 | 3 | 3 |
| 5 | 2 | 1 | 2 |
| 6 | 3 | 3 | 9 |
| 7 | 4 | 1 | 4 |
| 8 | 5 | 3 | 15 |
| 9 | 6 | 1 | 6 |
| 10 | 7 | 3 | 21 |
| 11 | 8 | 1 | 8 |
| 12 | 9 | 3 | 27 |
| Total | — | — | 128 |
| Complement (10 − 128 mod 10) mod 10 | — | — | 2 |
EAN-13 check digit demonstration
The example 690123456789 uses the first 12 digits for demonstration; the check digit is derived by the algorithm, and the resulting number does not belong to any company.
The proper nouns involved in this article.
Modulo 10 operation, taking the remainder after division by 10. GS1 series check digits are all based on mod10.
The sum of each digit multiplied by its respective weight, an intermediate value in the check calculation.
Two adjacent digits written in reversed order, one of the most frequent types of manual entry errors.
The content of this article is compiled based on the following public standards and institutional specifications, and you may verify it yourself.
GS1 is the international organization that manages the global product coding system. Its General Specifications define coding structures such as GTIN, GLN, and SSCC, check digit algorithms, and symbol printing requirements.
All barcode examples on this site have been verified by reading back with open-source decoders, so you can check them yourself and avoid illustrations that "look right but cannot be scanned."
A product barcode is not a "pattern stuck on the packaging," but a structured string of numbers printed in graphical form…
Barcode BasicsQR codes hold more data, can correct errors, and can interact, but they cannot replace the EAN-13 at the checkout counter. Getting ...
GS1 SystemThe four lengths are not four versions, but four levels. The direct consequence of choosing the wrong length is: when the goods arrive at the warehouse...
Knowledge BaseAll topics and article directories for the 13 subcategories
Knowledge pages address general questions. When it comes to your specific products, markets, and channels, it is faster to ask a coding consultant directly.