In beta. Limited places.Open to everyone in Q1 2027

↑↓ to move · Enter to open · Esc to close

Catalog and entities

GTIN validator: check digit, length and prefix

A GTIN (Global Trade Item Number) is the number GS1 uses to identify a trade item, the one in the EAN or UPC barcode on the package. This validator checks your codes, one per line: whether they have 8, 12, 13 or 14 digits, whether the check digit matches GS1's method, and what the prefix says, for example whether it's restricted circulation, a book or a coupon. It runs in your browser and doesn't look anything up in a database.

Written by
Reviewed by
Published 8 min read

This check runs in your browser, so it needs JavaScript. Nothing you paste leaves this page.

Takeaway:

Key takeaways

  • A GTIN has 8, 12, 13 or 14 digits, and the last one is a check digit calculated from the others with GS1's method.
  • A valid check digit says the code is well formed, not that it's yours or that it belongs to that product. GS1's lookup, Verified by GS1, tells you that.
  • The prefix doesn't say where the product was made. Some ranges do change what you do with the code: restricted circulation, books, serial publications, coupons and refund receipts.
  • In Schema.org each length has its own property (gtin8, gtin12, gtin13, gtin14), and a book goes in isbn. Google asks for the numeric form, not the URL.
  • The validator runs in your browser on the codes you paste: it doesn't look anything up in a database or send anything.

A GTIN is the number that identifies a product in trade: the one encoded in the EAN and UPC barcodes on the package. This validator checks it on three things you can know without asking anyone: the length, the check digit and the prefix. It's for anyone who runs a store, or runs one for a client from an agency, and is about to publish those codes on their product pages, in a product feed or in their structured data: a code with one digit missing or one digit wrong doesn't show on the page, and it leaves the product with an identifier that identifies nothing.

The validator runs in your browser. It doesn't look anything up in a database, and what you paste doesn't leave the page. That's why it can tell you whether a code is well formed, but not whose it is (more on that below).

How to use it

  1. Pull the codes from your catalog, for example the barcode column of a product export.
  2. Paste them into the box, one per line, up to 500. Spaces and dashes are ignored: 952 1234 567899 and 952-1234567899 read the same.
  3. Press Check. "Load an example" fills the box with six cases: a valid code, the same code with the last digit wrong, a textbook UPC-A, a book, a restricted circulation number and a code one digit short.
  4. Read one row per code.

How to read the result

The table has four columns: the code as you pasted it, its length, the verdict and the result.

The verdict comes in three forms. "Valid" marked as correct: the length and the check digit are right. "Valid" marked as a warning: the code is well formed, but its prefix is restricted circulation and it shouldn't be published as a GTIN. "Invalid": something is wrong, and the result says what.

The result gathers what the validator found:

  • "Only digits are allowed." The code has letters or other characters.
  • "11 digits: a GTIN has 8, 12, 13 or 14." The length is none of the four.
  • "All zeros is not a GTIN."
  • "The check digit is 4 and should be 5." The last digit doesn't match the others.
  • What the prefix says, such as "A book (ISBN): publish it as isbn."
  • The Schema.org property that fits it, such as "Schema.org property: gtin13". It doesn't appear for invalid codes or for restricted circulation numbers.

The check digit, step by step

The last digit of a GTIN is a check digit: it's calculated from the others to confirm the number is put together correctly.⁠[1]GS1. Check digit calculator GS1's method has three steps.⁠[2]GS1. How to calculate a check digit manually

  1. Multiply each digit by 3 or by 1, alternating, starting with the digit just to the left of the check digit, which gets 3.
  2. Add up the results.
  3. Subtract that sum from the nearest multiple of ten equal to or above it. What's left is the check digit.

Here's an example with a number from prefix 952, which GS1 reserves for demonstrations and examples of its system.⁠[3]GS1. GS1 Company Prefix We want the check digit for the first twelve digits of a GTIN-13, 952123456789:

Digit 9 5 2 1 2 3 4 5 6 7 8 9
Weight 1 3 1 3 1 3 1 3 1 3 1 3
Result 9 15 2 3 2 9 4 15 6 21 8 27

The sum is 121. The nearest multiple of ten at or above it is 130, and 130 minus 121 is 9. The full GTIN-13 is 9521234567899.

Run it through the validator and it will pass. Now try two typical mistakes made when copying a code:

  • One digit changed. 9521234567896 ends in 6: the validator says the check digit is 6 and should be 9.
  • Two digits swapped. 9521234567989 swaps the 8 and the 9 near the end: the validator says the check digit is 9 and should be 1.

And one that isn't a copying mistake but a length mistake: 952123456789, the same twelve digits without the check digit, is read as a GTIN-12 whose last digit, the 9, would be the check digit, and it should be 6. One digit more or less is not the same code.

What the prefix says, and what it doesn't

The first digits of a GTIN are the GS1 prefix. The prefix doesn't say where the product was made: GS1 points this out, because a company can manufacture anywhere in the world.⁠[3]GS1. GS1 Company Prefix Country prefixes belong to the GS1 member organizations that issue them: a prefix says which of them issued the number, not where the product comes from.

What does matter are the ranges that change what you do with the code. The validator names these, all from GS1's list:⁠[3]GS1. GS1 Company Prefix

Prefix What it is What to do
020 to 029 and 200 to 299 Restricted circulation numbers within a geographic region, defined by each GS1 member organization Don't publish them as gtin: outside that region they identify nothing
040 to 049 Restricted circulation numbers within a company Same: they're internal numbers
977 Serial publications (ISSN) It's a magazine or a newspaper
978 and 979 Books (ISBN) Publish it as isbn
980 Refund receipts It isn't a product
981 to 983 and 99 GS1 coupons It isn't a product

Any other prefix comes out as "A GS1 company prefix.", and nothing more: the validator doesn't know whose number it is.

How the validator reads the prefix: in a GTIN-13, the first three digits; in a GTIN-12, with a zero in front, because GS1 says a 12-digit GTIN carries an implied leading zero and that the prefix of 614141234561 is 061, not 614;⁠[3]GS1. GS1 Company Prefix and in a GTIN-14, skipping its first digit. In a GTIN-8 it doesn't read the prefix at all: those numbers have their own ranges.

Which Schema.org property to use

In Product markup, Schema.org has one general property, gtin, and one per length, which gtin generalizes.⁠[4]Schema.org. gtin Google accepts the general one, but recommends the most specific one that applies, and only accepts the GTIN in numeric form, not as a URL.⁠[5]Google Search Central. Merchant listing (Product, Offer) structured data Schema.org does accept a GS1 Digital Link URL in gtin,⁠[4]Schema.org. gtin so the Schema.org validator can pass a value Google doesn't use.

Length Property Also known as
8 gtin8 EAN-8⁠[6]Schema.org. gtin8
12 gtin12 UPC⁠[7]Schema.org. gtin12
13 gtin13 EAN-13; a 12-digit UPC becomes a GTIN-13 with a zero in front⁠[8]Schema.org. gtin13
14 gtin14 GTIN-14
13, prefix 978 or 979 isbn ISBN-13

isbn comes with a condition: Google only accepts it on a Book node, so the node carries both types at once, "@type": ["Product", "Book"], and Google advises the 13-digit form of the ISBN.⁠[5]Google Search Central. Merchant listing (Product, Offer) structured data

Publish each code at the length it has. Schema.org says left-padding with zeros is not required or encouraged.⁠[4]Schema.org. gtin The GTIN doesn't replace the SKU, which is your internal reference, or the MPN, the manufacturer's reference: they are different product attributes, and Google recommends all three for merchant listings.⁠[5]Google Search Central. Merchant listing (Product, Offer) structured data

What a valid check digit doesn't prove

The check digit is calculated with an algorithm from the other digits,⁠[1]GS1. Check digit calculator and anyone can do it: you just did, with the example. That's why a code that's valid here is a well-formed code, not an assigned one. It doesn't prove the number was issued to a company, or that it belongs to the product in front of you.

GS1 answers that. To use its keys, a company first needs a GS1 Company Prefix, which it gets from the GS1 organization in its country,⁠[3]GS1. GS1 Company Prefix and its Verified by GS1 service lets you search for and verify the information behind a barcode number.⁠[9]GS1. Verified by GS1 If you have doubts about a code, especially one a supplier gave you or one that came out of a spreadsheet, look it up there.

What we tested

Tested on: browser and version, date.

Code Type Validator GS1 calculator Verified by GS1 Match?
9521234567899 This page's example
GTIN-8
12-digit UPC and the same with a zero in front
GTIN-14
ISBN-13
Restricted circulation
One digit changed
Two digits swapped

Sources

  1. [1] GS1. Check digit calculator. Accessed . ↑ ↑
  2. [2] GS1. How to calculate a check digit manually. Accessed . ↑
  3. [3] GS1. GS1 Company Prefix. Accessed . ↑ ↑ ↑ ↑ ↑
  4. [4] Schema.org. gtin. Accessed . ↑ ↑ ↑
  5. [5] Google Search Central. Merchant listing (Product, Offer) structured data. Accessed . ↑ ↑ ↑
  6. [6] Schema.org. gtin8. Accessed . ↑
  7. [7] Schema.org. gtin12. Accessed . ↑
  8. [8] Schema.org. gtin13. Accessed . ↑
  9. [9] GS1. Verified by GS1. Accessed . ↑

Change history

  • First English version.

Other questions

Are EAN, UPC and GTIN the same thing?
Nearly. GTIN is the number's name in the GS1 system; EAN and UPC are the names its most common forms go by. Schema.org puts it this way: GTIN-13 is equivalent to EAN-13 and to the 13-digit ISBN, GTIN-8 is EAN-8, and GTIN-12 is the UPC. A 12-digit UPC becomes a GTIN-13 by adding a zero in front.
Can I calculate a GTIN for a product that doesn't have one?
You can calculate a number that passes this validator, but it won't be a GTIN of yours. To use GS1 keys you need a GS1 Company Prefix, which you get from the GS1 organization in your country, and a correct check digit doesn't prove the number has been assigned. If the product has no GTIN, don't mark one up: Google asks for the identifiers that apply, not for one at any cost.
Do I need to pad my codes with zeros to 14 digits?
No. Schema.org says left-padding is not required or encouraged. Publish the code at the length it has, in the property for that length. If you paste a code padded to 14 digits, the validator will read it as a GTIN-14 and suggest gtin14, because it judges the length you give it.

Make your catalog easy for bots to read

Clione fills every product page with what bots read best: the JSON-LD graph with its structured data, the meta description and the FAQs. You review and press Push; then we check your live store so it all stays published.