Decode one
Scan or paste a barcode and see every part of it.
Make one
Generate a valid barcode from fields.
Where you’ll see it
- Consumer products at retail: groceries, cosmetics, household goods, packaged electronics.
- Books and periodicals. An ISBN is an EAN-13 starting 978 or 979, and an ISSN starts 977.
- Japan, where it’s called JAN. Japanese numbers start 45 or 49.
- North America, less often. Products there usually carry UPC-A, which is an EAN-13 with a leading zero left off. US and Canadian retailers have been expected to scan EAN-13 since 2005.
Anatomy
An EAN-13 symbol is 95 modules wide, where a module is the width of the narrowest bar or space. Each digit takes 7 modules, split into two bars and two spaces. The example uses GS1 prefix 952, which GS1 reserves for demonstrations, so it will never identify a real product.The first digit has no bars
Only 12 of the 13 digits have bars of their own. Each digit in the left half is drawn in one of two patterns, called L and G, and the mix of patterns across the six digits encodes the first digit. The right half always uses a third set of patterns, R.
A first digit of 0 means every left-half digit uses L, and those are the same bars as a UPC-A. That’s why a scanner can read a UPC-A as a 13-digit EAN-13 that starts with 0.
GS1 prefixes
The first three digits are the GS1 prefix. It tells you which national GS1 office issued the company prefix. It does not tell you where the product was made: a company that joined GS1 Germany uses a 400–440 prefix wherever its products are manufactured.
GS1 publishes the full list of prefixes.
After the GS1 prefix come the rest of the company prefix and then the item reference. Company prefixes vary in length, so you can’t tell from the digits alone where the company prefix ends and the item reference begins.
Size and quiet zones
At 100% size a module is 0.330 mm, making the symbol 37.29 mm wide including quiet zones, with 22.85 mm bars. On consumer items GS1 allows modules from 0.264 mm (80%) to 0.660 mm (200%). The blank margins on either side are the quiet zones: at least 11 modules on the left and 7 on the right. They’re part of the symbol, and artwork printed into them is a common reason for scans to fail.Check digit
The last digit is a check digit, calculated from the other 12 with the GS1 mod-10 algorithm. Scanners recalculate it on every read and reject any read where it doesn’t match. This catches every single-digit error and most cases of two adjacent digits swapped. To calculate it:- Multiply the first 12 digits alternately by 1 and 3, starting with 1.
- Add up the results.
- Subtract the total from the next multiple of 10. The difference is the check digit (0 if the total is already a multiple of 10).
Variants and related types
- UPC-A: 12 digits. Add a leading 0 and you get an EAN-13 with identical bars.
- EAN-8: 8 digits, for packs too small for an EAN-13.
- ISBN and ISSN: EAN-13 numbers with prefixes 978–979 and 977.
- Add-ons: a separate 2- or 5-digit barcode printed to the right, used for periodical issue numbers and book prices. Scanners only read it if they’re set up to.
- ITF-14: marks the case a product ships in. It carries a GTIN-14, which is often the item’s GTIN-13 with an extra digit in front.
- 2D barcodes: the same GTIN can be carried in a QR code or Data Matrix, alongside or eventually instead of the EAN-13.
Gotchas
- Your database has 12 digits but the scan has 13. The product carries a UPC-A. See an extra leading zero.
- The scan has extra digits on the end. An add-on was read along with the main barcode. See an add-on that came along.
- Prefix 20–29 numbers aren’t globally unique. Stores and regions reuse them, often with a weight or price embedded in the digits, so look them up with the retailer’s rules, not in a global product database.
- The prefix isn’t the country of origin, even though many apps present it that way.
Scanning it in your app
EAN-13 is in the Retail product group, along with every other barcode that identifies a product by its GTIN, including QR Code and Data Matrix when they carry one. Most apps that scan products should enable that group, not EAN-13 on its own.Specification
- ISO/IEC 15420:2025: the EAN/UPC barcode specification, covering encoding, dimensions and decoding.
- GS1 General Specifications: what the numbers mean, prefixes, and size and placement rules.