Skip to content
Qué Hay Detrás ES (versión en español) Sign in Open the app

Anatomy of the EAN-13: prefix, company, product and check digit

What a barcode is The GTIN and its variants Lesson 5 of 14

The thirteen digits of an EAN-13 are read in three logical blocks. The first digits are the GS1 prefix; contrary to popular belief, they don't indicate the country of manufacture but the country of the GS1 organisation that licensed the number. Prefixes 840-849 belong to GS1 Spain: a Spanish company that is a member of GS1 Spain receives them even if it manufactures in China, and a multinational may have prefixes from several countries depending on where it licensed each block.

The company block and the product block

After the prefix comes the company prefix: the numerical root that GS1 assigns to your company when you join. Its length varies with the size of the licensed block — a company with thousands of items has a short prefix and many free digits; an SME with twenty items, a long prefix. The remaining digits are allocated freely by the company to each product, without GS1 being involved.

This structure has an important governance consequence: global uniqueness is guaranteed by two layers — GS1 guarantees that two companies never share a prefix, and your company guarantees that it never repeats the product digits within its prefix. That is why duplicating a GTIN “through a set-up error” is a serious internal incident: it breaks the layer that only you control.

The check digit: the silent guardian

The last digit carries no information: it is calculated over the previous twelve with alternating weights of 1 and 3, adding them up and taking the complement to the next ten. Its job is to detect composition and reading errors: a transposition of adjacent digits, a digit misread by the scanner or a typing error when setting up the product almost always change the result, and the system rejects the number before it does any harm.

Do the calculation by hand at least once in your life: take a real EAN-13 from your larder, multiply alternately by 1 and 3 from the right, add up and round up to the next ten. Three minutes that will make you understand why no spreadsheet should allocate GTINs without this check built in.

What CANNOT be deduced from the number

Not the price, not the weight, not the expiry date, not even, with certainty, the country of manufacture. The EAN-13 says “who the product is in the global catalogue” — and nothing more. This lesson and the one on “what data it encodes” are two sides of the same principle: identifier yes, description no.

Calculating the check digit, step by step

Let's take the first twelve digits 840123456789 and calculate the thirteenth. We work through them from left to right, multiplying alternately by 1 and by 3, starting with 1: 8×1 + 4×3 + 0×1 + 1×3 + 2×1 + 3×3 + 4×1 + 5×3 + 6×1 + 7×3 + 8×1 + 9×3, that is 8 + 12 + 0 + 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 = 115. The check digit is what is missing up to the next ten: 120 − 115 = 5. The full GTIN is 8401234567895.

That calculation detects one hundred per cent of single-digit errors and almost all transpositions of two adjacent digits: the only ones it misses are those of two digits that differ by five, such as 05 keyed in as 50. On the other hand, it never detects the transposition of two digits with one other digit between them, because both are multiplied by the same weight. These are known gaps of no practical importance — the scanner doesn't make random mistakes — but they are worth knowing before trusting everything to the check digit in manual entry.

The prefix is NOT the country of origin

This is the most widespread misunderstanding in the sector and the one that causes the most trouble with consumers. The prefix of an EAN-13 indicates the GS1 organisation that assigned the range of numbers to the company, not where the product was made or where its ingredients come from. A Spanish company with prefix 84 can manufacture in any country, and a company from elsewhere can sell a product made in Spain.

Prefix 84 means “this company registered with GS1 Spain”, nothing more. Any claim about the product's origin has to be based on the labelling, which is regulated, and not on the barcode. It is an indicative piece of data, useful as a starting clue, never as proof.

Estructura del EAN-13 8401234567895 y cálculo de su dígito de control
Lesson diagram (in Spanish) · Enlarge diagram

Exercise

Structure of the EAN-13

How many digits does an EAN-13 code have?

  1. 8 digits
  2. 13 digits
  3. 12 digits

What role does the check digit play in an EAN-13?

  1. It indicates the country of manufacture
  2. It identifies the product category
  3. It checks that the number has been composed and captured correctly

Related lessons

Reading is free. When you sign up, you also:

  • You save your progress and pick up where you left off
  • You take the exams, marked straight away
  • You receive a completion record, with your name, for each course you finish
  • You ask and answer in the Community (in Spanish)
  • You get the PRO level by adding your products
  • With PRO, you unlock the advanced tools: labels, GS1-128 and SSCC

Unlock PRO tools and completion records Free. The team reviews every application.

Already have access?Mark this lesson as read in My academy

This lesson is part of the course Barcode and GTIN Fundamentals, from the Barcode and Traceability Academy.

This module includes the exam “Module 1 exam: Fundamentals”.

Next lesson Common GTIN allocation mistakes and how to avoid them 9 lessons left in the course