Try it

EAN, GTIN, MPN and product codes

Sortyra team · · 8 min read

An EAN (now called a GTIN) is a globally unique number under the barcode, assigned by the manufacturer. An MPN is the manufacturer's product code, and the SKU or product code is your own internal number. Comparison sites, Google and marketplaces use the EAN to recognise that it's the same product and assign your offer to the right product page.

Why products need codes

Imagine twenty online shops selling the same sleeping bag. One calls it "Horalka Mummy 800 sleeping bag blue", another "HORALKA mummy-800 sleeping sack", a third "Mummy sleeping bag to -5 °C". A person understands that these are the same thing; a computer doesn't. That's why every product has codes – numbers that don't change depending on who describes the product and how.

A code is like a product's passport number: the name can change, the code stays. In product feeds (files listing products – the basics are in What is a product feed) you will mainly come across four kinds of code.

Codes at a glance

CodeWho assigns itUniqueExample
EAN / GTINthe manufacturer (a number from the GS1 organisation)worldwide8580004987658
MPNthe manufacturerwithin that manufacturerHM-800-BL
SKU / product codeyou (the retailer)in your online shopSPAC-118
ID in the feedyouin the feedSPAC-118

EAN and GTIN

The EAN (European Article Number) is the number under the barcode on the packaging. It most often has 13 digits. Today its official name is GTIN (Global Trade Item Number), which is the common name for the whole family of these numbers:

  • GTIN-13 (EAN-13) – the usual 13-digit code in Europe,
  • GTIN-8 (EAN-8) – a short code for small packages,
  • GTIN-12 (UPC) – a 12-digit code used mainly in the USA and Canada,
  • GTIN-14 – a code for larger packs and cartons, not for individual units,
  • ISBN-13 – the code for books, which is also a valid EAN (it starts with 978 or 979).

So when Google asks for a gtin and Heureka for an EAN, in practice they mean the same number.

EANs are assigned by the manufacturer or brand owner, who buys a range of numbers for this from GS1 (in Slovakia, GS1 Slovakia). The first digits indicate the country of the GS1 organisation that issued the number – for example 858 is Slovakia and 859 is Czechia. They do not indicate the country of manufacture: goods made in Asia can have a Slovak prefix if a Slovak company registered them.

MPN

The MPN (Manufacturer Part Number) is the code a manufacturer uses for a product in its catalogue, for example HM-800-BL. It is unique only within one manufacturer – another brand may use the same code for completely different goods. That's why the MPN is always used together with the brand. Google asks for it for products that have no GTIN.

SKU and product code

The SKU (Stock Keeping Unit), often called the "product code" or "catalogue number" in online shops, is your internal number. You decide it yourself, and it helps you find your way around your warehouse and shop. Your supplier has its own codes; you can have different ones. Outside your shop, the SKU means nothing. In Heureka, the manufacturer's or seller's code is given in the PRODUCTNO field.

ID in the feed

Every item in a feed must have a unique identifier – ITEM_ID in Heureka, id in Google. Most often this is the SKU. What matters is that it never changes: the channel uses it to link the product's history, statistics and ads. If you change the ID, the channel treats it as a new product.

What codes look like in a feed

The same sleeping bag in a feed for Heureka and for Google:

<!-- Heureka -->
<SHOPITEM>
  <ITEM_ID>SPAC-118</ITEM_ID>
  <PRODUCTNO>HM-800-BL</PRODUCTNO>
  <EAN>8580004987658</EAN>
  <MANUFACTURER>Horalka</MANUFACTURER>
</SHOPITEM>

<!-- Google Merchant Center -->
<item>
  <g:id>SPAC-118</g:id>
  <g:mpn>HM-800-BL</g:mpn>
  <g:gtin>8580004987658</g:gtin>
  <g:brand>Horalka</g:brand>
</item>

The check digit: how to verify that an EAN is valid

The last digit of an EAN is the check digit. It is calculated from the other digits, so a typo in any one digit can be detected. The calculation for EAN-13:

  1. Take the first 12 digits.
  2. Multiply the digits in odd positions (1st, 3rd, 5th …) by 1 and those in even positions (2nd, 4th, 6th …) by 3.
  3. Add everything up.
  4. The check digit is the number you need to add to reach the next multiple of 10.

Example for the made-up code 858123456789?:

Position123456789101112
Digit858123456789
Weight131313131313
Result8158329415621827

The total is 126. The next multiple of 10 is 130, which is 4 away, so the check digit is 4 and the full code is 8581234567894. If the feed contained 8581234567895, it would be invalid.

Why codes matter so much

  • Matching on comparison sites. Heureka and Zboží use the EAN to assign your offer to a product page with competitors' prices. Without it, the product often appears outside the product page. More in Feeds for price comparison sites.
  • Google Shopping. Google uses the GTIN to recognise the product and place it in the right results; for branded goods without a GTIN it may limit how often they're shown.
  • Marketplaces. An offer is almost always attached to an existing product page by EAN.
  • Merging suppliers. You recognise the same product from two wholesalers by its EAN, even if they use different codes and names (more in Supplier feeds).

What to watch out for

  • Don't make up EANs. A made-up or "borrowed" number may belong to another product. Google and marketplaces check who a number belongs to and reject such offers.
  • Internal codes are not EANs. Numbers starting with 20 to 29 are reserved for in-store use (for example goods sold by weight) and aren't valid outside the shop.
  • Shared EAN across a series. Some suppliers give one EAN to every size or colour. But each variant should have its own EAN; otherwise the comparison site merges them into a single product page.
  • Lost zeros. When opened in Excel, an EAN can lose its leading zero or turn into 8.58E+12. Open the column with codes as text.
  • Spaces and hyphens. An EAN in a feed should have no spaces or hyphens – digits only.
  • If there is no EAN, for example for handmade goods or your own products, don't invent one. Google lets you set identifier_exists to no for such products. If you want to sell your own products on marketplaces, apply for your own GS1 number range.

How Sortyra helps

Sortyra merges products from several suppliers by EAN, or by product code, and recognises a shared EAN across a series so that different products aren't merged by mistake. When the EAN is missing, it matches supplier products with your shop and with each other even without it – uncertain pairs are shown to you for review (see Own warehouse). You can set a prefix for supplier codes so they don't clash. In the Product matching section you get suggestions for products without a valid EAN – always with a valid check digit and with the source stated; you approve every suggestion yourself. Sortyra never makes up EANs. More on the Product matching page.

Frequently asked questions

What is the difference between an EAN and a GTIN?

GTIN is the official common name for the family of barcode numbers, and EAN-13 is its most widespread type in Europe. When a channel asks for a GTIN, that's usually where your EAN goes.

Where do I find a product's EAN?

On the packaging under the barcode, in the manufacturer's documentation, or in the supplier's feed or price list. If you don't have it, ask your supplier.

Can I make up an EAN?

No. EANs are assigned by the manufacturer from a range obtained from GS1. A made-up number may belong to another product, and channels reject such offers.

What is an MPN and when should I give one?

The MPN is the manufacturer's product code. It is given together with the brand, mainly when the product has no EAN, for example for spare parts.

Is a SKU the same as an EAN?

No. A SKU is your internal number that you choose yourself; an EAN is a globally unique number from the manufacturer. You can include both in a feed, each in its own field.

How do I find out whether an EAN is valid?

Check the check digit – the last digit must match the calculation from the previous twelve. To check who a code belongs to, use the GS1 database.

Try it on your own feed