The short answer
UPC-A (Universal Product Code) holds 12 digits and was created in the United States in the 1970s. EAN-13 (European Article Number, now officially called International Article Number) holds 13 digits and was built on top of UPC so that the rest of the world could join the same system. Both encode a product number called a GTIN: a UPC-A carries a GTIN-12, an EAN-13 a GTIN-13.
The key fact is that the two are compatible. Put a 0 in front of a 12 digit UPC-A and you get a valid EAN-13 with the same check digit. Since 2005, retail scanners in North America have been required to read EAN-13 as well, so a product with either barcode can be sold in most stores. You choose the format based on where you sell and which number your GS1 office issued, not on scanner support.
Try it here: EAN-13 Barcode Generator
Open the full tool pageSide by side comparison
The two symbols look almost identical: the same bar widths, the same longer guard bars at the start, middle and end, and the same 95 module wide structure. The differences are in the number of digits and how they are printed under the bars.
| Feature | UPC-A | EAN-13 |
|---|---|---|
| Digits | 12 | 13 |
| Product number | GTIN-12 | GTIN-13 |
| Main region | United States, Canada | Europe, Asia, Latin America, most of the world |
| Check digit | Last digit | Last digit |
| Human readable digits | First and last digit outside the bars | First digit outside the bars, then two groups of six |
| Short version for small packs | UPC-E (6 digits) | EAN-8 (8 digits) |
| Read by scanners worldwide | Yes | Yes |
| Convert to the other | Add a leading 0 | Only possible if it starts with 0 |
How the digits are built
An EAN-13 starts with a GS1 prefix of two or three digits. It identifies the GS1 member organization that issued the number, not the country where the product was made. A Turkish company gets numbers starting with 869, a Spanish one 84, a Mexican one 750, but all of them can produce goods anywhere. Next comes the company prefix, then the item reference chosen by the company, and finally the check digit.
Some prefixes have special meanings worth knowing: 978 and 979 are used for books (the EAN-13 is the ISBN), 977 for magazines and other serials, and 20 to 29 are reserved for in-store use such as weighed products, so they are not unique outside one retailer. Numbers starting with 0 are UPC compatible and were issued by GS1 US or GS1 Canada.
In a UPC-A the first digit is the number system digit (0, 1, 6, 7, 8 and 9 for regular products, 2 for weighed items, 3 for medicines, 5 for coupons), followed by the company prefix, the item reference and the check digit.
How the check digit is calculated
Both formats end with a check digit that lets the scanner catch a misread. The calculation is the same idea in both. For EAN-13, multiply the first 12 digits alternately by 1 and 3, starting with 1 on the left, add everything up, and the check digit is the number that brings the total to the next multiple of 10.
Example: for 590123412345 the weighted sum is 83, so the check digit is 7 and the full code is 5901234123457. For UPC-A the weights start with 3 on the left instead: for 03600029145 the sum is 58 and the check digit is 2, giving 036000291452. Written as an EAN-13, that is 0036000291452, with the same check digit, which is why adding a 0 always works.
You do not need to calculate it yourself. In the generator above, type 12 digits for EAN-13 (or 11 for UPC-A) and the check digit is added; type the full code and it is verified. A wrong digit is reported with its line number and the correct code, for example The check digit should be 7. With Barcode type on Automatic, a 12 digit number whose last digit is a valid UPC check digit is drawn as UPC-A; any other 12 digit number is treated as an EAN-13 without its check digit, and the 13th digit is added. Since a 12 digit EAN number can happen to pass the UPC check, pick UPC-A or EAN-13 yourself when you want to be sure.
Which one do you need?
- Selling in stores or on marketplaces in the US and Canada: retailers and Amazon US accept both, but numbers from GS1 US are traditionally printed as UPC-A. Use the format your GS1 office gave you.
- Selling in Europe, Turkey, Latin America, the Middle East or Asia: use EAN-13. This is what local GS1 offices issue and what retailers expect.
- Very small packages: EAN-8 exists for items with no room for a full symbol, but EAN-8 numbers are issued separately by GS1 and are not a shortened version of your EAN-13.
- Books: use the ISBN as an EAN-13 starting with 978 or 979.
- Internal use only (your own warehouse, shelf labels, stock codes): you do not need GS1 numbers at all. Code 128 is usually a better choice because it also holds letters.
Where barcode numbers come from
A barcode is only as good as the number inside it. The generator draws a correct symbol for any valid number, but retailers and large marketplaces check whether the number is registered to your company in the GS1 database. Numbers bought cheaply from resellers often belong to someone else, and listings with them can be blocked.
The safe route is to join the GS1 organization in your country, which assigns a company prefix and lets you number your own products. The fee depends on the country and on how many numbers you need.
Printing tips that prevent scan failures
- Keep the size. The standard EAN-13 and UPC-A symbol is about 37.3 mm wide and 25.9 mm tall at 100%. Scanners handle roughly 80% to 200% of that; go smaller only after testing.
- Do not cut the bars short. Truncating the height to fit a label makes the code harder to scan from an angle.
- Leave the light margins. EAN-13 needs a quiet zone of 11 modules on the left and 7 on the right; UPC-A needs 9 on each side. Never print text or a border inside them.
- Use dark bars on a light background. Black on white is safest; red bars or a dark background often fail because scanners use red light.
- Print labels at 100% scale. When printing the PDF label sheet, choose actual size, not fit to page, so every bar keeps its width.