EAN-13 Calculator
Use this tool to calculate the missing check digit for a 12-digit EAN code or validate a full 13-digit EAN barcode.
What is an EAN-13 check digit?
EAN-13 stands for European Article Number, a widely used barcode format for retail products. The final digit (the 13th digit) is called the check digit. It is computed from the first 12 digits and helps systems detect common data-entry errors, such as mistyped numbers.
How the EAN-13 check digit is calculated
The formula is simple and fast:
- Take the first 12 digits.
- Add digits in odd positions (1st, 3rd, 5th, etc.).
- Add digits in even positions (2nd, 4th, 6th, etc.) and multiply that subtotal by 3.
- Add both totals together.
- The check digit is the number needed to reach the next multiple of 10.
Compact formula
If S is the weighted sum of the first 12 digits, then:
Check Digit = (10 - (S mod 10)) mod 10
Worked example
Let’s calculate the check digit for 400638133393:
- Odd-position sum = 4 + 0 + 3 + 1 + 3 + 9 = 20
- Even-position sum = 0 + 6 + 8 + 3 + 3 + 3 = 23
- Weighted total = 20 + (23 × 3) = 89
- 89 mod 10 = 9
- Check digit = (10 - 9) mod 10 = 1
So the full valid EAN-13 is 4006381333931.
Why this matters in real systems
Check digits improve reliability in barcode scanning, inventory software, and point-of-sale systems. While they do not guarantee that a product code is “real” in a catalog, they do verify that the code follows EAN-13 mathematical rules.
Common mistakes to avoid
- Using 11 or 13 digits when you mean to calculate from exactly 12.
- Forgetting that alternating weights are position-based from the left.
- Including letters or symbols in input.
- Assuming a valid check digit means the product exists in a database.
Quick FAQ
Is EAN-13 the same as UPC?
They are closely related barcode standards. UPC-A can be represented within EAN-13 with a leading zero in many cases.
Can I use this for ISBN-13?
Yes. ISBN-13 uses the same check digit algorithm as EAN-13.
Does this tool accept spaces or dashes?
Yes. Non-digit characters are removed automatically before calculation and validation.