> For the complete documentation index, see [llms.txt](https://feedshine.gitbook.io/feedshine-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://feedshine.gitbook.io/feedshine-docs/gtin-check-digits-a-practical-guide-for-product-feeds.md).

# GTIN check digits: a practical guide for product feeds

How the GS1 check digit works, a worked EAN-13 example, and the barcode mistakes that get products rejected by Google Shopping.

Google Shopping, Meta and most marketplaces validate the barcode (GTIN) on every product. If the last digit doesn't match, the product gets a warning or is disapproved. This page explains how that last digit works, how to check it, and the mistakes that cause most rejections.

## What a GTIN is

A GTIN (Global Trade Item Number) is the number under a product barcode. There are four lengths:

| Length | Name             | Where you see it                       |
| ------ | ---------------- | -------------------------------------- |
| 8      | GTIN-8 (EAN-8)   | Small packs                            |
| 12     | GTIN-12 (UPC-A)  | North America                          |
| 13     | GTIN-13 (EAN-13) | Most of the world, including Australia |
| 14     | GTIN-14          | Cartons and cases                      |

The last digit of every GTIN is a **check digit**, calculated from the other digits.

## How the check digit is calculated

GS1 uses a mod-10 calculation:

1. Take every digit except the last.
2. Starting from the right, multiply them by 3, 1, 3, 1 and so on.
3. Add the results.
4. The check digit is the number that takes the total up to the next multiple of 10. If the total is already a multiple of 10, the check digit is 0.

### Worked example

EAN-13 body: `400638133393`

From the right: 3×3 + 9×1 + 3×3 + 3×1 + 3×3 + 1×1 + 8×3 + 3×1 + 6×3 + 0×1 + 0×3 + 4×1 = **89**

Next multiple of 10 is 90, so the check digit is **1**. Full GTIN: `4006381333931`.

## The mistakes that get products rejected

| Problem                                | Example                          | Fix                                                                                                                            |
| -------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Wrong check digit                      | `4006381333932`                  | Re-copy from the packaging or supplier sheet                                                                                   |
| Leading zeros dropped by a spreadsheet | `36000291452` (11 digits)        | Format the column as text; a UPC-A should be 12 digits                                                                         |
| Scientific notation                    | `4.00638E+12`                    | Format as text before pasting                                                                                                  |
| Spaces or dashes                       | `4006381 333931`                 | Strip everything that isn't a digit                                                                                            |
| Restricted prefix                      | `2001234567893`                  | Prefixes 020–029, 040–049 and 200–299 are in-store codes, not global GTINs. Leave the GTIN blank and use a brand + MPN instead |
| Made-up barcodes                       | Any number not licensed from GS1 | Buy a GS1 licence or mark the product as having no GTIN                                                                        |

## Free tools to check them

* [UPC and EAN check digit calculator](https://feedshine.neocities.org/) (single code or a whole list, runs in your browser)
* [Barcode Feed Checker on itch.io](https://feedshine.itch.io/barcode-feed-checker-gtin-upc-ean)
* [Source code on GitLab](https://gitlab.com/feedshine/gtin-check) (MIT, no dependencies)

## Checking every product automatically

[FeedShine](https://feedshine.app/) is a Shopify app that builds Google Shopping, Meta and TikTok product feeds. It runs this check on every variant before the feed goes out and flags the ones that would be rejected.

*Written by the FeedShine team with AI assistance.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://feedshine.gitbook.io/feedshine-docs/gtin-check-digits-a-practical-guide-for-product-feeds.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
