# What is a check digit? Calculation for EAN and GTIN

> The check digit is the last digit of an EAN and GTIN, calculated from the others. How to work it out, why channels reject an invalid EAN and what to avoid.

Source: <https://sortyra.com/glossary/gtin-check-digit-calculation>

---

[Sortyra](https://sortyra.com/) [Glossary](https://sortyra.com/glossary) [A – D](https://sortyra.com/glossary/a-d)

# Check digit

Sortyra team · June 1, 2026 · 3 min read

[Glossary](https://sortyra.com/glossary)

[A – D](https://sortyra.com/glossary/a-d) [E – H](https://sortyra.com/glossary/e-h) [I – L](https://sortyra.com/glossary/i-l) [M – P](https://sortyra.com/glossary/m-p) [Q – T](https://sortyra.com/glossary/q-t) [U – X](https://sortyra.com/glossary/u-x)

- [301 redirect](https://sortyra.com/glossary/what-is-a-301-redirect)
- [Additional product images (additional_image_link)](https://sortyra.com/glossary/additional-image-link-feed)
- [Affiliate network](https://sortyra.com/glossary/what-is-an-affiliate-network)
- [Age group (age_group)](https://sortyra.com/glossary/age-group-attribute-google-feed)
- [AI content](https://sortyra.com/glossary/ai-generated-product-content)
- [AI Copilot](https://sortyra.com/glossary/what-is-ai-copilot)
- [API](https://sortyra.com/glossary/what-is-an-api)
- [Available quantity](https://sortyra.com/glossary/available-quantity-stock)
- [B2B and B2C](https://sortyra.com/glossary/b2b-vs-b2c-difference)
- [Bidding](https://sortyra.com/glossary/what-is-bidding-cpc)
- [Category taxonomy](https://sortyra.com/glossary/category-taxonomy-channels)
- [Category tree](https://sortyra.com/glossary/what-is-a-category-tree)
- [CATEGORYTEXT](https://sortyra.com/glossary/categorytext-heureka-category)
- [CDATA](https://sortyra.com/glossary/cdata-in-xml-feed)
- [Channel specification](https://sortyra.com/glossary/feed-channel-specification)
- [Conversion](https://sortyra.com/glossary/what-is-a-conversion-ecommerce)
- [Conversion rate](https://sortyra.com/glossary/conversion-rate-formula-ecommerce)
- [CPC (cost per click)](https://sortyra.com/glossary/what-is-cpc-cost-per-click)
- [CSV](https://sortyra.com/glossary/what-is-a-csv-file)
- [CTR](https://sortyra.com/glossary/what-is-ctr-click-through-rate)
- [Currency in a feed](https://sortyra.com/glossary/currency-in-product-feed)
- [Custom label (custom_label)](https://sortyra.com/glossary/custom-label-google-feed)
- [Data channel](https://sortyra.com/glossary/input-and-output-data-channels)
- [Data export](https://sortyra.com/glossary/what-is-data-export)
- [Data import](https://sortyra.com/glossary/what-is-data-import-products)
- [Data mapping](https://sortyra.com/glossary/data-mapping)
- [Data matching](https://sortyra.com/glossary/data-matching-products-categories)
- [Data source](https://sortyra.com/glossary/data-source-input-feed)
- [Deeplink](https://sortyra.com/glossary/what-is-a-deeplink)
- [Delivery time (DELIVERY_DATE)](https://sortyra.com/glossary/delivery-date-heureka-delivery-time)
- [Dropshipping](https://sortyra.com/glossary/what-is-dropshipping)
- [Duplicate product](https://sortyra.com/glossary/duplicate-products-in-feed)
- [Dynamic ads](https://sortyra.com/glossary/dynamic-ads-from-product-catalogue)

The check digit is the last digit of an EAN or GTIN number. It is not chosen at random but calculated from the other digits using a fixed formula. If a typo creeps in when the number is copied, the calculation no longer matches and the system knows at once that the number is wrong. That is why Google and comparison sites reject an invalid EAN.

**In this article**

1. What a check digit is
2. How it is calculated
3. What it is used for
4. What to watch out for
5. How Sortyra helps
6. Related terms
7. Frequently asked questions

## What a check digit is

It is like a control total on a till receipt: if someone changes one item when copying it, the total stops adding up. A check digit does the same for a number – it catches most common typos, for example one wrong digit or most swaps of two neighbouring digits.

IBANs and payment card numbers have a check digit too, each with its own formula. In feeds it is almost always a [GTIN](https://sortyra.com/glossary/what-is-a-gtin), that is, [EAN](https://sortyra.com/glossary/what-is-an-ean-code), UPC and ITF-14.

## How it is calculated

Here is the procedure for EAN-13, using the first 12 digits `858123456789`:

1. Multiply the digits in **odd** positions from the left (1st, 3rd, 5th …) by 1, and those in **even** positions by 3.
2. Add up the results.
3. The check digit is the number needed to reach the next multiple of ten.

| Digit | 8 | 5 | 8 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 8 | 15 | 8 | 3 | 2 | 9 | 4 | 15 | 6 | 21 | 8 | 27 |

The sum is 126. To reach 130 you need 4, so the check digit is **4** and the full EAN is `8581234567894`. If the sum comes out as an exact multiple of ten, the check digit is 0.

For other GTIN lengths (8, 12, 14 digits) the same rule applies, only the weights are counted from the right: the digit right next to the check digit has weight 3, the next 1, and so on.

## What it is used for

- **Google Merchant Center** rejects or restricts products with an invalid GTIN.
- **Comparison sites and marketplaces** match offers by EAN – a faulty number leads to no match or to the wrong product page.

## What to watch out for

- **A valid check digit does not mean the right product** – a number can be valid but belong to different goods.
- **Shortened numbers** – Excel removes leading zeros and turns a valid number into an invalid one.
- **Adding a check digit to an incomplete code** – this gives a valid-looking but invented number. GTINs are assigned by the manufacturer.
- **Spaces and hyphens** – they have to be removed before checking.

## How Sortyra helps

In rules you can use the condition **is a valid EAN** or **is an invalid EAN** and fix or leave out products with a faulty number. Only a GTIN with a valid check digit goes into outputs for Google and Heureka, and **Product matching** suggests a missing EAN only with a valid check digit and a stated source.

## Related terms

- [EAN](https://sortyra.com/glossary/what-is-an-ean-code)
- [GTIN](https://sortyra.com/glossary/what-is-a-gtin)
- [Product identifier](https://sortyra.com/glossary/product-identifier-id-ean-mpn)
- [Shared EAN](https://sortyra.com/glossary/shared-ean-product-series)
- In more detail: [EAN, GTIN, MPN, product code](https://sortyra.com/knowledge-base/ean-gtin-mpn-product-code) and [The most common feed errors](https://sortyra.com/knowledge-base/common-feed-errors-how-to-fix)

## Frequently asked questions

### How do I check whether an EAN is valid?

Recalculate the check digit using the procedure above. If the result matches the last digit, the number is formally valid.

### Can I create my own EAN with a check digit?

No. You will get a valid-looking number, but it is not assigned to your product, and channels may link it to someone else's goods.

### Why does Google report an invalid GTIN even though I copied it from the packaging?

Most often a leading zero was lost or a typo crept in. Check the number of digits and the check digit.

[← Previous article **Channel specification**](https://sortyra.com/glossary/feed-channel-specification) [Next article → **Conversion**](https://sortyra.com/glossary/what-is-a-conversion-ecommerce)

## Try it on your own feed

[Try it free](https://app.sortyra.com/registracia?lang=en) [Book a 15-min call](https://sortyra.com/contact)
