Authoritative Source & Methodology
This tool validates European Article Numbers (EAN) based on the global standards defined by GS1, the organization responsible for developing and maintaining global standards for business communication, including barcodes.
- Source: GS1 General Specifications
- Reference: Check Digit Calculation (Module 7.9)
- Official Link: GS1 Check Digit Calculator
All calculations are strictly based on the standard Modulo 10 (MOD10) check digit calculation algorithm published by GS1.
The EAN Check Digit Formula Explained
The final digit of any EAN barcode is a calculated "check digit." This digit ensures the code's integrity by verifying that the other digits were read or entered correctly. The calculation uses a Modulo 10 algorithm with alternating weights.
EAN-13 (GTIN-13)
For an EAN-13 code, the first 12 digits (the payload) are used to calculate the 13th digit (the check digit).
- Assign alternating weights of 1 and 3 to the 12 payload digits, starting with 1 from the left.
- Multiply each digit by its corresponding weight.
- Sum all the resulting products to get a total sum, $S$.
- Find the remainder when $S$ is divided by 10 (this is $S \pmod{10}$).
- If the remainder is 0, the check digit $C$ is 0. Otherwise, subtract the remainder from 10.
Weights: $w_1=1, w_2=3, w_3=1, \dots, w_{12}=3$.
Sum $S = \sum_{i=1}^{12} (d_i \times w_i)$
Check Digit $C = (10 - (S \pmod{10})) \pmod{10}$
EAN-8 (GTIN-8)
For an EAN-8 code, the first 7 digits are used to calculate the 8th digit. The weighting pattern is reversed.
- Assign alternating weights of 3 and 1 to the 7 payload digits, starting with 3 from the left.
- Multiply each digit by its weight.
- Sum all the products to get a total sum, $S$.
- Calculate the check digit $C$ using the same Modulo 10 formula as above.
Weights: $w_1=3, w_2=1, w_3=3, \dots, w_7=3$.
Sum $S = \sum_{i=1}^{7} (d_i \times w_i)$
Check Digit $C = (10 - (S \pmod{10})) \pmod{10}$
Glossary of Terms
- EAN (European Article Number)
- A standard barcode, a superset of the North American Universal Product Code (UPC), used in global trade to identify a specific retail product.
- GTIN (Global Trade Item Number)
- The official name for the data structures (like EAN-13 or EAN-8) that uniquely identify trade items. EAN-13 is synonymous with GTIN-13.
- Check Digit
- The final digit of a barcode, calculated from all the other digits. It acts as a built-in error checker.
- Payload
- The sequence of digits in a barcode *excluding* the check digit (e.g., the first 12 digits of an EAN-13).
- Modulo 10 (MOD10)
- A mathematical operation that finds the remainder after division by 10. It's the core of the check digit algorithm.
How It Works: A Step-by-Step Example (EAN-13)
Let's validate the EAN code: 4006381333931.
- Payload: The first 12 digits are
400638133393. - Provided Check Digit: The 13th digit is
1. - Apply Weights (1, 3, 1, 3...):
- $4 \times 1 = 4$
- $0 \times 3 = 0$
- $0 \times 1 = 0$
- $6 \times 3 = 18$
- $3 \times 1 = 3$
- $8 \times 3 = 24$
- $1 \times 1 = 1$
- $3 \times 3 = 9$
- $3 \times 1 = 3$
- $3 \times 3 = 9$
- $9 \times 1 = 9$
- $3 \times 3 = 9$
- Sum Products (S): $S = 4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89$
- Find Remainder: $S \pmod{10} = 89 \pmod{10} = 9$
- Calculate Check Digit (C): $C = 10 - 9 = 1$
- Compare: The calculated check digit (
1) matches the provided check digit (1). Therefore, the EAN code is valid.
Frequently Asked Questions
What's the difference between EAN, UPC, and GTIN?
GTIN (Global Trade Item Number) is the overall term for the data structure. EAN-13 is a 13-digit GTIN. UPC-A (Universal Product Code) is a 12-digit barcode standard, primarily used in North America. A 12-digit UPC-A can be converted to an EAN-13 by adding a leading '0'. This tool will treat a 12-digit number as a payload for an EAN-13, effectively treating it as a UPC-A.
Can I make up my own EAN code?
No. While you can *calculate* a valid check digit for any string of numbers, a real EAN code must be licensed from your local GS1 organization. The first digits (the GS1 Company Prefix) are assigned to a specific company, allowing their products to be uniquely identified worldwide.
Does a "valid" code mean the product exists?
No. This tool is a mathematical validator. It only confirms that the code's format, length, and check digit are correct according to the GS1 algorithm. It does not check a database to see if this EAN has been assigned to a real product. For that, you would need a service like GS1's "Verified by GS1".
Why did my 12-digit code get a check digit?
If you enter 12 digits, the tool assumes you have a UPC-A or an EAN-13 payload and calculates the 13th digit (the check digit) for you. The resulting 13-digit number is the complete, valid EAN-13 code.
What if my code is 9, 10, or 14 digits?
This tool only validates EAN-8 and EAN-13 (and by extension, UPC-A). Other barcode formats like GTIN-14, ISBN-13 (which is a type of EAN-13), or code-128 have different structures or check digit rules. This validator will report any number that isn't 7, 8, 12, or 13 digits as an invalid length.
Tool developed by Ugo Candido.
Content reviewed by the CalcDomain Editorial Board.
Last accuracy review: