Skip to main content
Skip to main content

EAN-13 & UPC-A / GTIN Validator

Validate official GS1 Modulo 10 check digit math for EAN-13, UPC-A, and GTIN product barcodes.

How does validation work?

The Global Trade Item Number (GTIN), implemented as EAN-13 (13 digits globally) and UPC-A (12 digits in North America), is the universal product barcode standardized by GS1 and ISO/IEC 15420.

The final digit is the Check Digit calculated using universal GS1 math with alternating weights 3 and 1 from right to left, requiring the total sum to be a multiple of 10.

Anatomy & Structure of EAN-13 / GTIN-13 Barcode

The EAN-13 barcode (GS1 standard) consists of 13 digits organized into regulatory blocks:

PositionFieldLengthMeaning & FunctionExample
1 to 3GS1 Prefix3 digitsIdentifies the GS1 Member Organization that licensed the company (e.g., 789 = Brazil, 000-139 = USA/Canada).789
4 to 7Company Prefix4-5 digitsUnique licensed business identifier allocated by GS1.1234
8 to 12Item Reference4-5 digitsSequential product item code assigned by the manufacturer.56789
13Check Digit1 digitChecksum digit calculated using Modulo 10 with alternating weights 1 and 3.0

GS1 Check Digit Calculation Algorithm (Modulo 10)

The 13th digit of the EAN-13 ensures optical scan accuracy in point-of-sale systems globally:

CheckDigit = (10 - ((Σ d[odd] × 1 + Σ d[even] × 3) % 10)) % 10
  1. 1. Alternating Weights: working from right to left (excluding the check digit), assign alternating weights 3 and 1 to each digit.
  2. 2. Multiply and Sum: multiply each digit by its weight and compute the total sum.
  3. 3. Modulo 10: divide the sum by 10 to obtain the remainder (Sum % 10).
  4. 4. Ten's Complement: the check digit is the number needed to round up to the nearest multiple of 10 ((10 - remainder) % 10).

Frequently Asked Questions on Validation

What is the relationship between UPC-A and EAN-13?
Any 12-digit UPC-A can be represented as a 13-digit EAN-13 by prepending a leading 0 without altering the check digit.
What do the first 3 digits of EAN-13 indicate?
They indicate the GS1 national organization prefix (e.g. 789/790 Brazil, 000-139 US/Canada, 300-379 France, 400-440 Germany, 560 Portugal, 840-849 Spain).