EAN-13 Check Digit Calculator
Enter the first 12 digits to generate a check digit, or enter all 13 digits to validate a full EAN-13 barcode.
What is an EAN-13 code?
EAN-13 (European Article Number, 13 digits) is one of the most common barcode standards used on retail products worldwide. It is also part of the broader GTIN family (Global Trade Item Number). Every EAN-13 value contains a final check digit that helps scanners detect typing errors.
A typical EAN-13 number is made up of:
- A GS1 prefix (country or organization allocation range)
- A company and item reference section
- A final check digit used for validation
How this EAN13 calculator works
This calculator supports two use cases:
- 12-digit input: It computes and returns the correct 13th check digit.
- 13-digit input: It validates whether the existing check digit is correct.
The check digit formula
The EAN-13 algorithm applies alternating weights to the first 12 digits:
- Digits in odd positions (1, 3, 5, ...) are multiplied by 1.
- Digits in even positions (2, 4, 6, ...) are multiplied by 3.
- Add everything together.
- Check digit =
(10 - (sum mod 10)) mod 10.
This method catches most common data-entry mistakes, especially single-digit errors and many transpositions.
Practical example
Suppose your first 12 digits are 400638133393. The correct check digit is 1, so the full EAN-13 becomes:
4006381333931.
You can paste either the 12-digit base or the full 13-digit code into the calculator above and verify the result instantly.
Where EAN-13 is used
- Retail packaging and point-of-sale scanning
- Inventory and warehouse systems
- E-commerce product feeds
- Internal catalog and SKU mapping workflows
Common mistakes to avoid
1) Mixing UPC-A and EAN-13 formats
UPC-A uses 12 digits, while EAN-13 uses 13 digits. Some systems convert between them by adding a leading zero, but validation rules still need to match the target format.
2) Including separators in raw values
Barcode labels may include spaces or dashes for readability. Databases and APIs usually expect pure numeric strings.
3) Assuming any 13-digit number is valid
A random 13-digit sequence can fail checksum validation. Always verify with a check digit calculator before import or printing.
FAQ
Can I use this for ISBN-13 numbers?
Yes. ISBN-13 uses the same checksum logic as EAN-13, so this calculator can validate the numeric checksum portion.
Does a valid check digit guarantee the product exists?
No. It only proves the number is mathematically well-formed. Product ownership and registration still depend on GS1 data and your source system.
Is this calculator suitable for developers?
Absolutely. It is helpful when testing barcode validation logic, QA scripts, import pipelines, or POS integrations.