Skip to content

Google Shopping

How GTIN Check Digits Work: Calculate, Validate and Convert UPC, EAN and GTIN-14

How the GTIN check digit is calculated, with worked EAN-13, UPC-A and GTIN-8 examples, conversion rules, and why valid-looking codes still fail. …

Von Binu Mathew

CEO, itmarkerz technologies

Veröffentlicht 10 Min. Lesezeit

How GTIN Check Digits Work: Calculate, Validate and Convert UPC, EAN and GTIN-14

The last digit of every GTIN, UPC and EAN is a check digit: a number calculated from the others so that typing mistakes and scanning errors can be caught automatically. When Google Merchant Center or a marketplace rejects a code as invalid, it is usually this last digit that fails. This guide explains exactly how the check digit is calculated, works through three real examples, shows how to convert between UPC-A, EAN-13 and GTIN-14, and lists the reasons valid-looking codes still fail. You can try every calculation yourself with the free GTIN Check Digit Calculator , which shows the arithmetic step by step.

What a GTIN check digit is

A GTIN (Global Trade Item Number) identifies a product model in trade. It comes in four lengths: GTIN-8 (also called EAN-8), GTIN-12 (UPC-A), GTIN-13 (EAN-13) and GTIN-14. In every one of them the final digit is a check digit calculated from the digits before it under the GS1 standard. A code is well formed only when the last digit matches the calculation. The check digit protects against the most common mistakes: a single wrong digit and most swaps of two neighbouring digits.

Format Length Where you see it
GTIN-8 (EAN-8) 8 digits Small packs where a longer code will not fit
GTIN-12 (UPC-A) 12 digits Retail products in North America
GTIN-13 (EAN-13) 13 digits Retail products in most of the world, and books as ISBN-13
GTIN-14 14 digits Cases, cartons and multipacks

How to calculate a check digit, step by step

  1. Write the code without its last digit.
  2. Starting from the right, at the digit next to the check digit, multiply the digits alternately by 3 and 1: the first by 3, the next by 1, the next by 3, and so on to the left.
  3. Add all the products together.
  4. The check digit is the number you must add to reach the next multiple of 10. If the sum is already a multiple of 10, the check digit is 0.

The rule always starts with a weight of 3 at the digit nearest the check digit, whatever the code length. That is why the same method works for all four formats.

Worked example 1: an EAN-13

Take the 12 digits 400638133393 and calculate the last digit of the EAN-13.

Digit 4 0 0 6 3 8 1 3 3 3 9 3
Weight × 1 × 3 × 1 × 3 × 1 × 3 × 1 × 3 × 1 × 3 × 1 × 3
Product 4 0 0 18 3 24 1 9 3 9 9 9

The products add up to 89. The next multiple of 10 is 90, so the check digit is 90 − 89 = 1. The full EAN-13 is 4006381333931.

Worked example 2: a UPC-A

Take the 11 digits 03600029145 and calculate the last digit of the UPC-A.

Digit 0 3 6 0 0 0 2 9 1 4 5
Weight × 3 × 1 × 3 × 1 × 3 × 1 × 3 × 1 × 3 × 1 × 3
Product 0 3 18 0 0 0 6 9 3 4 15

The sum is 58. The next multiple of 10 is 60, so the check digit is 2, and the full UPC-A is 036000291452.

Worked example 3: a GTIN-8

Take the seven digits 7351353.

Digit 7 3 5 1 3 5 3
Weight × 3 × 1 × 3 × 1 × 3 × 1 × 3
Product 21 3 15 1 9 5 9

The sum is 63. The next multiple of 10 is 70, so the check digit is 7, and the full GTIN-8 is 73513537.

To verify a full code, do the same calculation on all but the last digit and compare the result with the last digit. The calculator has a verify mode, and the GTIN / UPC / EAN Validator checks many codes at once.

Converting between UPC, EAN and GTIN-14

UPC-A to EAN-13

Add a zero at the front. A leading zero does not change the weighted sum, so the check digit stays the same. The UPC-A 036000291452 becomes the EAN-13 0036000291452.

EAN-13 to UPC-A

This only works when the EAN-13 begins with a zero. Drop that zero to get the UPC-A. An EAN-13 that begins with any other digit has no UPC-A form.

Item code to GTIN-14

A GTIN-14 identifies a packaging level, such as a case of six items. It is one indicator digit (1 to 8), then the first twelve digits of the item’s EAN-13 (without its check digit), then a newly calculated check digit. For the EAN-13 0036000291452, the case with indicator 1 is built from 1 + 003600029145, and its check digit is 9, giving 10036000291459. The check digit changes because the digits and their weights changed.

Why a code with a correct check digit can still fail

A valid check digit proves only that the number is well formed. It does not prove that GS1 issued the number to the brand that is using it. These are the common reasons a code is rejected anyway:

  • The GTIN was invented. Making up a number that passes the maths is still a false identifier. Marketplaces and Google can detect numbers not registered to the brand.
  • Leading zeros were lost. Spreadsheets treat codes as numbers and drop leading zeros or turn long codes into scientific notation. Format the column as text before importing or exporting.
  • The wrong length was sent. Only 8, 12, 13 and 14 digits are valid. A 10-digit or 15-digit code cannot be a GTIN.
  • A GTIN-14 was used for a single item. Case-level codes should not be sent for consumer products.
  • The same GTIN was used for different products. Each product model, and each variant that is sold separately, needs its own GTIN.
  • The code is not the manufacturer’s. Resellers must use the GTIN the brand owner assigned, not one they created.

If you sell something without a GTIN, such as a handmade or custom item, do not create one. Send the brand and manufacturer part number, and where the marketplace allows it, mark that no identifier exists. The rules for when a GTIN is needed are covered in the GTIN and UPC compliance guide .

How GTIN errors show up in Google Merchant Center

An invalid check digit appears as an invalid value for the gtin attribute, and products with a missing identifier can be limited or disapproved depending on the category. The Merchant Center Disapproval Diagnostic lists both issues with their causes and fixes, and the Google Shopping Feed Audit tests every GTIN in your feed against the check-digit rule before you submit it.

Keeping GTINs clean in your catalog

  1. Store GTINs as text in every system and export, so leading zeros survive.
  2. Validate on entry. Reject a code as soon as its length or check digit is wrong, instead of finding out at channel level.
  3. Keep the source. Record where each GTIN came from (manufacturer file, packaging, GS1 record) so questions can be answered later.
  4. One GTIN per sellable variant. Do not reuse a GTIN across colours or sizes.
  5. Audit regularly. Run the whole catalog through a validator each time you import supplier data.

Clean identifiers are one part of product data quality and its effect on Google Shopping results . For the wider process of building a feed that passes review, see the feed audit checklist .

Frequently asked questions

How is a GTIN check digit calculated?

Multiply the digits by 3 and 1 alternately, starting with 3 at the digit next to the check digit and moving left. Add the products. The check digit is the number needed to reach the next multiple of 10, or 0 if the sum is already a multiple of 10.

Does a valid check digit mean the GTIN is real?

No. It only shows the number is well formed. A GTIN is genuine only if GS1 issued it to the brand owner. Never make up a GTIN, even if it passes the check-digit test.

How do I convert a UPC-A to an EAN-13?

Add a zero at the front. The check digit stays the same because a leading zero does not change the weighted sum. Going the other way only works when the EAN-13 starts with zero.

What is a GTIN-14 and how is it built?

A 14-digit code for cases or packs. It is an indicator digit from 1 to 8, then the first 12 digits of the item’s EAN-13 without its check digit, then a new check digit calculated over all 13 digits.

Why do my GTINs lose leading zeros?

Spreadsheets treat codes as numbers and drop leading zeros. Format the column as text before importing or exporting, and store GTINs as text in every system.

What should I do if my product has no GTIN?

Do not create one. Send the brand and manufacturer part number, and where the channel allows it, mark that no identifier exists. Custom and handmade products commonly have no GTIN.

Teilen

Über den Autor

Binu Mathew

Binu Mathew

CEO, itmarkerz technologies

Binu Mathew is the CEO of itmarkerz technologies and founder of LynkPIM — a modern product information management platform built for growing e-commerce brands. He has spent years working at the intersection of product data, digital commerce, and catalog operations, helping teams eliminate data silos, enforce quality standards, and publish accurate product content at scale. His work spans PIM strategy, marketplace syndication, and Digital Product Passport compliance.

Kostenlose Tools zum Ausprobieren

Setzen Sie es in die Praxis um

LynkPIM führt einen gesteuerten Datensatz pro Produkt und veröffentlicht ihn in jedem Kanal. Ihre ersten 25 Produkte sind kostenlos, alle Funktionen inklusive.