Use EAN Validator

Enter your data below to use the EAN Validator

📌 Try these examples:
RESULT

Last updated

What Is an EAN Barcode?

EAN (European Article Number) is the international standard for product barcodes, managed by GS1. EAN-13 (13 digits) is the most common format, used on retail products worldwide. EAN-8 (8 digits) is a shorter variant for small packages. The UPC-A barcode used in North America is technically a subset of EAN-13 (EAN-13 with a leading zero).

EAN-13 Structure

DigitsMeaning
1–3GS1 Prefix (country/company prefix assigned by GS1)
4–12Company and product reference (assigned by the company)
13Check digit (calculated from the first 12)

Check Digit Calculation

The EAN-13 check digit uses a weighted sum algorithm. Multiply alternating digits by 1 and 3, sum them, then the check digit is (10 − (sum mod 10)) mod 10:

JavaScript
function validateEAN13(barcode) {
  if (!/^\d{13}$/.test(barcode)) return false;
  const digits = barcode.split('').map(Number);
  const sum = digits.slice(0, 12).reduce((acc, d, i) =>
    acc + d * (i % 2 === 0 ? 1 : 3), 0
  );
  const checkDigit = (10 - (sum % 10)) % 10;
  return checkDigit === digits[12];
}

console.log(validateEAN13('4006381333931')); // true (Nivea cream)
console.log(validateEAN13('4006381333932')); // false (wrong check digit)

Common EAN Prefixes

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.