Skip to content
All posts

GTIN, EAN, UPC and MPN explained: matching supplier codes to the right product

Every supplier sheet is full of codes, and only some of them are barcodes. Here is what a GTIN, an EAN, a UPC and an MPN each are, how to tell a sound barcode from a damaged one, and the order to match them in so each row lands on the right product.

Before5.01235E+12
After5012345678900
Barcode column

Have a supplier file like this? Send it exactly as it arrived and see the same products before and after.

GTIN vs EAN vs UPC: one number, several names

A GTIN is the barcode number a manufacturer assigns to a product, and EAN and UPC are two of its lengths: an EAN has 13 digits and a UPC has 12. So the question of GTIN vs EAN vs UPC has a short answer. Every EAN is a GTIN, every UPC is a GTIN, and neither needs converting to go into a GTIN field.

GTIN stands for Global Trade Item Number. Google Merchant Center lists the forms it accepts, and the list doubles as a map of what turns up in supplier files.1

NameDigitsGoogle’s description
UPC12In North America, GTIN-12
EAN13In Europe, GTIN-13
JAN8 or 13In Japan, GTIN-13
ISBN13For books
ITF-1414For multipacks, GTIN-14
The GTIN forms Google Merchant Center lists, with its own descriptions. Spaces and dashes are accepted in the number but ignored.

Two practical points follow. A 13-digit barcode is an EAN and a GTIN at the same time, so there is nothing to translate between them. And length carries meaning: a 14-digit code in a column of 13-digit ones may identify a multipack or an outer case rather than the single item a shopper buys, and it deserves a second look before it goes anywhere near a product page.

Supplier sheets rarely label the column GTIN. Look for Barcode, EAN, EAN13, UPC or Code, or for a column of 12 and 13-digit numbers with no heading at all. One column often mixes the two lengths, which is fine: each value is checked on its own terms.

MPNs, SKUs and dealer codes are not barcodes

An MPN is the manufacturer’s own part number for a product, and a SKU or dealer code is the supplier’s internal reference. None of them is a GTIN, and none follows a fixed format or carries a check digit.

The MPN is the one worth keeping. It is how a manufacturer tells its own products apart, so together with the brand it identifies a product even where no barcode exists, and Google asks for brand and MPN on products that have no GTIN.1 OpenAI’s product feed specification for ChatGPT wants the MPN sent “preserving its punctuation and casing”, always with the brand, and never invented to stand in for a missing GTIN.2

Punctuation matters more than it looks. To a person, NX-4821-W and NX4821W are the same code. To a machine comparing strings they are different, and a match that fails on a hyphen fails without saying so.

SKUs and dealer codes are a different kind of thing. A supplier’s SKU is a key into the supplier’s own system and means nothing outside it; your SKU for the same product is a key into yours. Plenty of suppliers send nothing but a code like that. It can still be matched, but only by finding the product it refers to and confirming it on the page, not by treating it as an identifier the rest of the world shares.

CodeAssigned byFormatCheck digitIdentifies
GTIN (EAN, UPC)The manufacturer8, 12, 13 or 14 digitsYes, the last digitOne trade item, wherever it is sold
MPNThe manufacturerLetters, digits and punctuationNoA product within its brand
Supplier SKUThe supplierAnythingNoA line in the supplier’s system
Your SKUYouAnythingNoA line in your system
The four kinds of code a supplier row can carry, and what each can be trusted to identify.

How to check a barcode’s check digit

The last digit of every GTIN is calculated from the digits before it, so you can tell whether a barcode is internally consistent with nothing but arithmetic. GS1 US describes it as the digit that “helps to confirm the integrity of your barcode number”.3 The calculation is the same for every length:

  1. Set the last digit aside, and work with the digits before it.
  2. Starting from the rightmost of those and moving left, multiply them by 3, 1, 3, 1 and so on.
  3. Add the results together.
  4. Take the remainder after dividing by 10. The check digit is 10 minus that remainder, or 0 when the remainder is 0.
Digit501234567890
Weight131313131313
Result501631251872490
The working for 501234567890, an example number. The results add up to 90, which divides by 10 exactly, so the check digit is 0 and the full GTIN-13 is 5012345678900.
Digits before the check digitWeighted sumRemainderCheck digitFull GTIN-13
50123456789090005012345678900
40063813339389914006381333931
Two worked examples. The first is the remainder-zero case. In the second, 89 leaves a remainder of 9, so the check digit is 10 minus 9, which is 1.

Weighting from the right is what lets one method serve every length. An 8, 12, 13 or 14-digit GTIN is checked the same way, and a zero added at the front changes nothing, because zero times any weight is zero. That is why a 12-digit UPC can be written into a 13-digit column with a 0 in front and still pass.

Nobody does this by hand for a whole catalogue. The same four steps fit in a spreadsheet formula or a few lines of code that check every row at once, and GS1 US offers a calculator for the odd one-off.

The check digit catches any single wrong digit. It catches most swaps of two neighbouring digits as well, but not all of them: swap two neighbours that differ by 5, such as 1 and 6, and the weighted sum moves by exactly 10, so the error slips through. Google also rules out some ranges however well formed the number is. It asks sellers not to submit GTINs with the restricted prefixes 02, 04 or 2, or in the coupon ranges 05, 98 or 99.1

How spreadsheets break barcodes

Spreadsheets treat a barcode as a number, and two things happen to numbers that should never happen to codes. In Microsoft’s own words, “Excel automatically removes leading zeros, and converts large numbers to scientific notation, like 1.23E+15”.4

The two failures look alike and are not. A dropped leading zero can be put back. A UPC that arrives with 11 digits has lost its first zero, and because a leading zero never changes the check digit, you can restore it and confirm the rest with the calculation above.

Scientific notation is worse, and whether it can be undone depends on where the value is. Inside the original Excel workbook, a 13-digit barcode shown as 5.01235E+12 may still be whole: Excel holds numbers to 15 significant digits, so the display may have changed while the number has not. If what reached you is the text 5.01235E+12, in a CSV or pasted into another system, six significant digits survive and the other seven are gone. No arithmetic brings them back. The only fix is to get the barcode again, from a copy of the supplier’s file that has not been through a spreadsheet, or from the product page.

Codes of 16 digits or more fare worse: Excel keeps 15 significant digits and rounds everything after the fifteenth down to zero. No GTIN is that long, but long supplier SKUs and serial numbers are.

As receivedWhat it wasWhat happenedCan it be repaired?
12345678905012345678905A 12-digit UPC lost its leading zeroYes. Restore the zero and confirm the check digit
5.01235E+125012345678900A 13-digit EAN turned into scientific notationOnly inside the original workbook. As text, re-source it
12345678901234501234567890123456A 16-digit supplier code lost its last digitNo. Re-source it
Three ways a spreadsheet damages a code, and which of them can be repaired. Illustrative numbers.

Prevention is simpler than repair. Microsoft’s advice is to set identifier columns to text as the data is imported, with Get & Transform (Power Query), rather than afterwards, because formatting a column as text “will not change numbers that have already been entered”.4 For a supplier file the simplest rule is not to open and re-save it in a spreadsheet before the codes have been read, and to pass it on exactly as it arrived.

Matching supplier codes to the right product

Match in order of certainty: a valid GTIN first, then brand and MPN together, and a match on the product’s name only when the specifications on the page confirm it.

  1. A valid GTIN. The right length, a check digit that passes, and outside the ranges Google rules out. Look for pages carrying that exact number. Nothing else on the row is as strong.
  2. Brand and MPN, together. The part number exactly as the manufacturer writes it, with the brand beside it. A part number on its own is not enough, because nothing stops two manufacturers using the same one.
  3. Name, confirmed by specifications. When neither code exists, a name match is a lead, not an answer. Accept the page only when at least one hard specification on it, such as a dimension, a capacity or a voltage, agrees with what you already know.
  4. Otherwise, unmatched. A product that cannot be matched with confidence should be marked as unmatched, not filled from the nearest lookalike.

Whichever step a match comes from, write it down. A note that says “matched on GTIN”, or “brand and MPN, width confirmed on the page”, tells the next person how much weight the row will bear. It is also the first thing to look at when a customer says the product in the box is not the one on the page.

The trap in the second step is the region. A GTIN identifies one version of a product, which is why Google asks for a separate GTIN for each variant.1 Model codes and part numbers are looser. Manufacturers often sell versions of a model in different countries with a different plug, voltage or label, and the code on a supplier sheet does not always say which version it means. A page for the right code can still describe the wrong product, so before copying a value across, check one hard specification on the page against the product in your warehouse.

Do not give up on a product too soon, either. On one job for a percussion and pro-audio retailer, 212 products came back empty on the first pass. We put twenty of them straight back through, with no code changes and nothing retyped, and fourteen came back with a real source attached. They were never missing, just badly searched.

Identification is the first step of the whole job, and everything after it depends on getting it right. The guide to product data enrichment sets out the steps that follow.

Why Google and ChatGPT ask for identifiers

Channels ask for identifiers because an identifier is how they recognise a product as one they already know. Google says products with missing or incorrect GTINs “may have limited visibility”, and that products with no unique identifiers at all are difficult to classify and may not be eligible for all of its Shopping programmes or features.1

The same page is just as firm in the other direction. Give a GTIN only when you are sure it is correct, and when in doubt leave it out. A shop-brand product, or one you are the only seller of, generally has none, and neither does the custom-made dress in Google’s own example. Its instruction is plain: “don’t guess or make up a value”.

OpenAI’s specification for ChatGPT product feeds is stricter about format. It wants “exactly 8, 12, 13, or 14 digits, including a valid check digit”, with leading zeros preserved and no spaces or dashes, and the GTIN omitted when none has been assigned.2 Google accepts spaces and dashes but ignores them, so the form that satisfies both is the bare digits, stored as text.

What an AI assistant does with the rest of your product data is a subject of its own; the post on AI shopping assistants covers it.

What a clean identifier column looks like

A clean identifier column holds one code per product, stored as text, of the right length, with a check digit that passes and a record of where it was confirmed.

  • Text, not numbers. Digits only, leading zeros kept, no spaces or dashes.
  • One GTIN per variant. Each size and colour has its own. A supplier row that gives one barcode for a product in five sizes is giving you, at best, one of the five.
  • The right length and a passing check digit. 8, 12, 13 or 14 digits, checked with the method above, and outside the restricted and coupon ranges.
  • Case codes kept apart. A 14-digit multipack or case code belongs in a column of its own, not in the one a product page reads.
  • Brand and MPN filled in as well. They are the fallback when a GTIN turns out to be wrong, and the only identifiers a product without a GTIN has.
  • Blank where there is nothing. An honest gap is better than a guess.
  • A source for every code. The page or document where the number was confirmed, so the next person can check it in one click.

That last habit saves the most time later, and it is how RefynData’s product data enrichment treats every value: each SKU or barcode is matched to the real product, each source page is checked to confirm it shows that product, and every value keeps a link to where it came from. If you are setting up these checks for a new supplier, the guide to supplier data onboarding shows where they fit.

Questions

Is an EAN the same as a GTIN?

Yes. An EAN is the 13-digit form of the GTIN, the Global Trade Item Number, and it is the form Google lists for Europe. A UPC is the 12-digit form used in North America. Both are GTINs, both end in a check digit calculated from the digits before it, and both go into a GTIN field as they are, with nothing to convert.

What does MPN mean?

MPN stands for manufacturer part number: the code a manufacturer gives a product within its own range. It has no fixed length, no set format and no check digit, so it only identifies a product when it is paired with the brand. Keep its punctuation and capital letters exactly as the manufacturer writes them, because a machine treats NX-4821-W and NX4821W as two different codes.

What should I do if a product has no GTIN?

Leave the field blank rather than guess, and supply the brand and MPN instead. Google advises against submitting a GTIN for a product that does not have one, such as a shop-brand product, and against guessing or making one up. OpenAI’s product feed specification for ChatGPT also says to omit the GTIN when none has been assigned.

Can a barcode in scientific notation be fixed?

Only while it is still inside the original workbook, where Excel may be holding all thirteen digits behind the display. Once it has travelled as text, a value like 5.01235E+12 keeps six significant digits and the rest are gone. Get the barcode again from a copy of the supplier’s file that has not been through a spreadsheet, or from the product page, and store it as text.

Does a valid check digit mean the barcode is right?

No. It means the number is well formed. It catches any single wrong digit and most swaps of neighbouring digits, but it cannot tell you whether the number belongs to this product. A valid GTIN on the wrong row passes every check, so a match should always be confirmed against the product page as well.

Sources

  1. Google Merchant Center Help. GTIN [gtin]. Read .
  2. OpenAI Developers, Agentic Commerce. Products: product feed specification for ChatGPT. Read .
  3. GS1 US. Check Digit Calculator. Read .
  4. Microsoft Support. Keeping leading zeros and large numbers. Read .

Try it on a fileyour supplier sent

Nothing goes live without your sign-offEvery value keeps its sourceYour data is never shared

Send one supplier spreadsheet exactly as it arrived. We will show you the same products before and after, with a source on every value we add.

One email with the upload link. Nothing else lands in your inbox.