What is an EAN code: complete guide to identifying your products in the market
Structure, the difference between EAN-8 and EAN-13, and how to generate yours with automatic check digit validation
EAN is the barcode you see on every supermarket product, but its 13 digits, or the shorter 8-digit version, rarely get explained. This guide covers the format's definition, its variants, when to use it in your business, and how to generate one without errors.
What is an EAN code and how is it structured?
EAN is the international barcode standard for retail, managed by GS1. It encodes the country, the manufacturer and the product in digits.
EAN (European Article Number) is the barcode format that uniquely identifies a physical product at any organised point of sale. It's managed by GS1, the international organisation that assigns prefixes and has maintained the standard since 1977.
An EAN-13 code splits into four blocks: the country prefix (1 to 3 digits, for example 84 for Spain), the company code GS1 assigns to the manufacturer, the internal product reference and, at the end, a check digit that validates the code hasn't been copied or typed incorrectly.
When a checkout scanner reads the code, it doesn't read a price or a name: it reads that unique number, which the point-of-sale system cross-references against its database to show the product, the price and deduct stock. That's why the same EAN can never repeat across two different products in circulation.
How do EAN-8 and EAN-13 differ, and which one do you need?
EAN-13 has 13 digits and is the standard for most products. EAN-8 has 8 digits and is reserved for very small packaging.
EAN-13 is the default choice for any physical product you sell in retail: food, cosmetics, books, toys, textiles. If your packaging has room for a normal label, EAN-13 is what you need.
EAN-8 is the compact version designed for packaging too small for an EAN-13: individual chewing gum, sugar sachets, cosmetic samples. GS1 doesn't assign it freely: you have to justify to the organisation that the packaging size prevents using the standard format.
Technically they share the same logic (numeric digits plus a check digit calculated with the same formula); the difference is only the length and the number of digits reserved for product identification. If you're unsure which one applies to you, the barcode guide compares all 8 available formats and their use cases.
What advantages does using EAN codes bring to inventory and retail?
EAN codes enable automatic checkout scanning, real-time stock control and product traceability throughout the whole distribution chain.
The most direct advantage is speed: a laser or imaging scanner decodes an EAN in milliseconds, far faster and more error-free than typing in the price by hand. That reduces checkout queues and billing mistakes.
In inventory, every stock movement (intake, sale, return) gets logged against that unique code, letting you know in real time how much of each item is left without counting manually. Most management software (ERP, POS) assumes the product carries an EAN.
If you sell on marketplaces like Amazon or in large retail chains, the EAN isn't optional: it's an entry requirement. Without an EAN code registered in your name with GS1, many catalogues simply reject the product listing.
How are EAN codes generated, and which standards should you follow?
You need a company prefix assigned by GS1. The check digit is calculated automatically using a standard modulo 10 formula.
The first step isn't technical, it's administrative: registering with GS1 to get assigned a unique company prefix. That prefix is what guarantees your EAN doesn't clash with another company's anywhere in the world. GS1 charges an annual fee that varies according to your revenue.
Once you have your prefix, generating the code itself is free and instant: enter the first 12 digits and the EAN-13 generator calculates and validates the check digit automatically, without you having to do the modulo 10 calculation by hand.
The technical standard governing EAN-13 is ISO/IEC 15420, which sets minimum dimensions, quiet zones (the white margin around the code) and contrast. Downloading the code as SVG instead of PNG avoids it losing sharpness when scaled to different label sizes.
Why are EAN codes important for traceability?
EAN links every unit sold to its origin, batch and distribution route, enabling fast product recalls and reliable audits.
EAN identifies the product, but on its own it's usually not enough for full traceability: it's combined with other GS1 formats depending on the level of the supply chain. EAN-13 goes on the sales unit, ITF-14 identifies the master carton grouping several units, and GS1-128 adds structured data like batch or expiry when regulation requires it (fresh food, pharma).
This chain of identifiers is what lets a company, faced with a safety alert or a manufacturing defect, pinpoint exactly which batch to pull without withdrawing the entire stock from the market. Without standardised codes, that process would be manual and much slower.
If your business already uses EAN-13 for the product and needs the next step in logistics, Code 128 covers internal identifiers and GS1-128 covers structured traceability.
§CODIGO-QR.ES / PRO
Generate your EAN codes now
Create EAN-13 codes for free, with automatic check digit validation and download as PNG or SVG without a watermark.
Frequently asked questions
- What is the check digit of an EAN code?
- It's the last digit of the code, calculated with a modulo 10 formula over the preceding digits. It's there to catch reading or transcription errors: if someone mistypes a digit, the calculation won't match and the system rejects the code before processing it.
- How do I get a legal EAN code for my product?
- You register with GS1, pay the fee based on your revenue, and get assigned a company prefix. From there, you generate the EAN codes for your products yourself, within the range assigned to you.
- Can I use a made-up EAN code without registering with GS1?
- You can technically generate one, but it isn't valid for selling in organised retail or on marketplaces: the prefix won't be registered to you, and you risk it clashing with another product already registered. For internal use or testing it's fine, for real sales it isn't.
- Are EAN and UPC the same code?
- They're compatible but not identical. UPC-A is the standard used in the United States and Canada, with 12 digits. Technically it's an EAN-13 with an invisible leading zero: any EAN-13 scanner also reads UPC-A with no extra configuration.
- How long does it take to generate an EAN code once I have my prefix?
- Seconds. Registering with GS1 is the step that takes time (it can take days to process), but once you have your company prefix, generating each individual EAN code with check digit validation is instant.
Jose Flores
Founder of codigo-qr.es · codigo-qr.es
Jose Flores is the founder of codigo-qr.es, a dynamic QR code and barcode generation tool created in Barcelona in 2026. Specialized in digital solutions for small businesses, he builds tools that let restaurants, shops and professionals digitize their communication without their own technical infrastructure.
See also
More articles