EAN-13 Format Explained: Structure & Prefixes
EAN-13 is the global retail barcode outside North America. This breakdown covers each part of the 13 digits, what the leading GS1 prefix really tells you, and how the check digit is derived.
Anatomy of the 13 digits
An EAN-13 is a GTIN-13, which means it holds 13 digits. Those digits break into three logical parts followed by a single check digit:
- A GS1 prefix of two or three digits at the start.
- A company prefix that GS1 licenses to a brand. Together with the GS1 prefix this identifies the organization.
- An item reference that the brand assigns to each distinct product.
The 13th and final digit is the check digit. The boundary between the company prefix and the item reference is not fixed. It depends on how many item numbers a company licensed, so you cannot reliably split those two parts just by looking at the number.
| Part | Position | What it identifies |
|---|---|---|
| GS1 prefix | First 2 to 3 digits | The GS1 member organization that issued the prefix |
| Company prefix | Variable length | The brand licensed by GS1 |
| Item reference | Remaining digits | The specific product the brand assigns |
| Check digit | 13th digit | Guards against misreads |
What the leading prefix really means
The most common myth about EAN-13 is that the first digits tell you the country of manufacture. They do not. The leading GS1 prefix identifies the GS1 member organization that issued the company prefix, which is often described by country or region, but that is the numbering authority, not the factory.
A brand headquartered in one country can license a prefix from a GS1 office in another, and manufacturing can happen anywhere in the world. So a prefix commonly linked to one country only tells you which GS1 office allocated the number range. Treat it as an issuing-authority hint, never as proof of origin.
Never use the leading prefix to claim country of manufacture. A prefix in the 400 to 440 range is often called German, but it only means a German GS1 office allocated the number range. The goods themselves may be made anywhere in the world.
How the check digit is calculated
The final digit protects against misreads. To compute it for an EAN-13, take the first 12 digits and, working from the right, multiply them by alternating weights of 3 and 1. Sum the results, find the next multiple of ten at or above that sum, and subtract. The difference is the check digit, a number from 0 to 9.
A scanner runs the same math on every read and rejects the scan if the last digit does not match. You can walk through the arithmetic on any code with the EAN-13 check digit calculator, and confirm a whole number end to end with the barcode validation tool.
Here is a worked example on the 12 data digits 590123412345. Working left to right, apply alternating weights of 1 and 3, sum the products, then round the sum up to the next multiple of ten and subtract.
data: 5 9 0 1 2 3 4 1 2 3 4 5
weight 1 3 1 3 1 3 1 3 1 3 1 3
sum = 83 -> next ten = 90 -> check digit = 7
EAN-13 and UPC-A together
UPC-A is the 12-digit relative of EAN-13. Add one leading zero to a UPC-A and you have a valid EAN-13, which is why both scan on the same equipment worldwide. This is also why you should normalize catalog data: a UPC and its zero-padded EAN twin are the same product and should resolve to the same record.
To move a code between the two widths without recomputing anything by hand, use the GTIN converter. You can inspect a real product record at an example lookup such as this page.
Here is why the compatibility matters in practice. A scanner does not care whether it reads 12 digits or 13. It hands the decoded number to your system, and your system decides what it means. If you store the raw 12-digit UPC in one place and the zero-padded 13-digit EAN in another, the same physical product splits into two records. Normalize to 14 digits on the way in and that split disappears.
Generating a valid EAN-13
To create a legitimate EAN-13 you need a GS1-licensed company prefix. You assign an item reference under that prefix, calculate the check digit, and then render the barcode. Do not invent numbers, because a fabricated EAN can collide with a real product and will be rejected by retailers that verify against the GS1 registry.
Once you have a valid 13-digit value, the barcode generator produces a scannable image, and the API documentation shows how to validate and generate at scale.
Frequently asked questions
Does an EAN-13 prefix tell me the country of manufacture?
No. The leading prefix identifies the GS1 member organization that issued the company prefix. That is a numbering authority tied to a region, not the country where the item was made.
Can I tell where the company prefix ends and the item number begins?
Not from the number alone. GS1 assigns company prefixes of varying lengths, so the split between company prefix and item reference is not visible in the digits.
Is EAN-13 the same as GTIN-13?
Yes. GTIN-13 is the 13-digit identifier and EAN-13 is the barcode symbology that encodes it. The number is identical.
Try the tools
Related reading
What Is a GTIN? UPC, EAN & GS1 Barcode Standards
A GTIN is the GS1 Global Trade Item Number that sits above UPC, EAN and the 14-digit case code as one shared product identifier.
GTIN vs UPC: What is the Difference
UPC is not an alternative to GTIN. A UPC-A barcode carries a 12-digit GTIN-12, so UPC is one member of the wider GTIN family.
GTIN-14 Explained: Cases, Cartons & Pallets
GTIN-14 identifies a packaging level such as a case or carton by adding an indicator digit in front of the base product GTIN.
How to Validate a Barcode: UPC, EAN & GTIN
A practical guide to checking that a UPC, EAN, or GTIN is well formed before you trust it.