How to validate a UPC, EAN, or GS1 barcode before listing on Shopify

You typed a barcode into the Shopify variant field, saved the product, and moved on. Weeks later Google Merchant Center flags the item: “Invalid value [gtin].” The barcode looked right. It had the correct number of digits. But one number was off, the check digit did not match, and now the product is disapproved and invisible in Google Shopping. Barcode validation is the boring step that prevents this, and almost nobody does it before listing.
This guide covers what a valid barcode actually is (UPC, EAN, and the GTIN umbrella that ties them together), how the check digit works, how to spot a fake or mistyped code before it costs you feed approvals, and how to validate hundreds of them at once instead of one at a time. A barcode is not just a number. It is a number with rules, and the rules are checkable.
Quick note on who we are: we build Shopify apps and free tools at Craftshift, including a Barcode & UPC Validator that does the check-digit math for you. We will point to it where it saves time, but you can validate a single barcode by hand in about a minute once you know the method below.
In this post
- What makes a barcode valid: UPC, EAN, and GTIN
- How the check digit works (and how to verify it by hand)
- Why this matters on Shopify specifically
- The five most common barcode errors we see
- How to validate one barcode
- How to validate a whole catalog at once
- What to do if a product has no barcode
- Frequently asked questions
- Related reading
What makes a barcode valid: UPC, EAN, and GTIN
Start with the vocabulary, because merchants mix these up constantly. GTIN (Global Trade Item Number) is the umbrella term. UPC and EAN are specific formats that all fit under it. Here is the whole family in one table.
| Name | Digits | Also called | Where it is used |
|---|---|---|---|
| UPC-A | 12 | GTIN-12 | US and Canada retail |
| EAN-13 | 13 | GTIN-13 | Europe and most of the world |
| EAN-8 | 8 | GTIN-8 | Small packages where 13 digits will not fit |
| ITF-14 | 14 | GTIN-14 | Cartons and cases (wholesale) |
| ISBN | 13 | Bookland EAN | Books (a specialized EAN-13) |
Two rules make a code structurally valid. First, the digit count has to match one of the formats above. A 12-digit code is a UPC-A. A 13-digit code is an EAN-13. An 11-digit code is neither, so it is broken (usually a leading zero got stripped by a spreadsheet, which we will come back to). Second, the final digit has to be a correct check digit calculated from the digits before it. That second rule is where most “looks fine but fails” barcodes die.
There is a third rule that structural validation cannot see: the code has to actually belong to you (or the brand you resell). Legitimate GTINs trace back to a GS1 company prefix, the licensed block of numbers GS1 issues to a business. A code can pass the check-digit test and still be made up. More on that below, because Google checks it and Shopify does not.
How the check digit works (and how to verify it by hand)
The check digit is the last number in the barcode. It is not random. It is calculated from the other digits using a modulo-10 formula, and every barcode scanner on earth recomputes it to catch a misread. You can do the same math to catch a mistyped code before you list it.
Here is the method for a UPC-A (12 digits). Take the first 11 digits. Add up the digits in the odd positions (1st, 3rd, 5th…) and multiply by 3. Add up the digits in the even positions (2nd, 4th, 6th…). Add those two results together. The check digit is whatever you need to add to reach the next multiple of 10.
Worked example with the code 03600029145 (first 11 digits):
- Odd positions (0, 6, 0, 2, 1, 5) sum to 14. Times 3 = 42.
- Even positions (3, 0, 0, 9, 4) sum to 16.
- 42 + 16 = 58.
- Next multiple of 10 above 58 is 60. 60 minus 58 = 2.
- So the full valid UPC-A is 036000291452.
EAN-13 uses the same idea with the weighting flipped (even positions times 3). It is the same modulo-10 system. Do you want to do this by hand for 400 SKUs? No. Nobody does. That is exactly what the Barcode & UPC Validator automates: paste a code (or a column of them) and it tells you which ones fail the check digit and why. But knowing the math means you understand what “invalid” actually means when a tool or Google flags it.
Why this matters on Shopify specifically
Shopify stores the barcode on each variant in a field labeled Barcode (ISBN, UPC, GPC, etc.). And here is the catch that trips people up: Shopify does not validate it. You can type 123456789012, or a code with a wrong check digit, or an 11-digit fragment, and Shopify saves it without a warning. The field is just a text box. So the barcode looks stored and correct in your admin while being completely invalid.
The consequences show up downstream, where the barcode is actually read:
- Google Shopping / Merchant Center. Google maps your Shopify barcode field to the
gtinattribute. An invalid GTIN triggers “Invalid value [gtin]” and the product is disapproved. A GTIN that passes the check digit but does not match Google’s own product catalog can trigger “Incorrect identifier [gtin].” Either way, no free listings, no Shopping ads for that SKU. - Marketplace sync (Amazon, eBay, Meta). These channels require a real, GS1-issued GTIN for most branded products. A fake one gets the listing suppressed.
- POS and inventory scanners. If the check digit is wrong, a physical scanner may refuse the code or scan it as a different product.
So the barcode field is one of those Shopify inputs where the platform gives you no guardrails and the cost of a mistake lands months later in a channel you were counting on for traffic. Validate before you list, not after Google tells you.
The five most common barcode errors we see
After running a lot of merchant catalogs through the validator, the same handful of problems come up again and again.
- The stripped leading zero. A UPC-A that starts with 0 becomes 11 digits the moment it passes through Excel or Google Sheets as a number instead of text. This is the single most common barcode error in Shopify CSV imports. Format the column as text before you paste.
- Wrong check digit. A single mistyped digit anywhere in the code makes the final check digit wrong. Structurally 12 digits, still invalid.
- The made-up placeholder. Codes like 000000000000, 111111111111, or a sequential 123456789012 that someone entered “just to fill the field.” They fail everywhere it counts.
- Duplicate barcodes across variants. Two different variants sharing one barcode. Each sellable variant needs its own unique GTIN. This is a big one for apparel, where the same code gets pasted across every size.
- Restricted-range codes used as real ones. Codes starting with certain prefixes are reserved (for example, internal or coupon ranges) and are not valid retail GTINs even though the check digit passes.
Notice how many of these are spreadsheet problems, not barcode problems. The barcode was fine until a CSV mangled it. If you import products with a CSV, run the file through a CSV validator as well, and keep barcode columns formatted as text.
How to validate one barcode
For a single product, the manual path is quick:
- Count the digits. 12 = UPC-A, 13 = EAN-13, 8 = EAN-8. Anything else is wrong. If you land on 11, you probably lost a leading zero.
- Check the check digit using the modulo-10 method above, or drop the code into the Barcode & UPC Validator and let it do the math.
- Sanity-check the source. Did it come off the physical product’s packaging or a GS1-issued list? If someone typed it from memory, verify it.
- Paste it into Shopify as text, and confirm no trailing spaces snuck in (another silent killer).
How to validate a whole catalog at once
Doing this per-product does not scale past a few dozen SKUs. For a full catalog, the workflow is:
- Export your products from Shopify (Products > Export > CSV). The barcode lives in the
Variant Barcodecolumn. - Paste the barcode column into the Barcode & UPC Validator, which flags every failing code and tells you whether it is a digit-count problem, a check-digit problem, or a duplicate.
- Fix the flagged rows in your CSV (format as text first so you do not re-break the leading zeros).
- Re-import. If you are rebuilding the CSV from scratch, our Product CSV Generator keeps the barcode column formatted correctly.
Valid barcodes also feed directly into a clean Google Shopping feed, which is where a lot of Shopify stores quietly leak free traffic. If Shopping is part of your plan, pair this with our guide to Shopify Google Shopping feed optimization, where the GTIN attribute is one of the first things Google checks.
What to do if a product has no barcode
Not every product needs a GTIN. If you make your own products (handmade, private label, one-of-a-kind), you may not have one, and that is fine. Two paths:
- Buy a real GS1 prefix if you plan to sell into retail, Amazon, or big marketplaces that require it. GS1 issues the numbers; you assign them to your products.
- Tell Google the product has no GTIN rather than inventing one. In your feed, set
identifier_existsto no for genuinely GTIN-less products. Google then relies on brand plus MPN. Do not paste a fake number to fill the field. A missing GTIN is allowed; a fake GTIN is a disapproval.
One more structural note for stores that sell one product in many colors as separate products. Each color-as-product needs its own GTIN, and grouping them visually with Shopify combined listings does not change that. The swatch on the collection page is a display layer; underneath, every distinct sellable item still carries its own barcode. Keep them unique.
Frequently asked questions
How do I know if a UPC is valid?
A valid UPC-A has exactly 12 digits and a correct check digit (the last digit), computed from the first 11 using a modulo-10 formula. If the digit count is off or the check digit does not match, the code is invalid. You can verify by hand with the modulo-10 method or paste the code into a barcode validator that does the math automatically.
Does Shopify check barcodes for me?
No. The Shopify barcode field is a plain text box with no validation. It accepts invalid codes, wrong check digits, and made-up numbers without any warning. Validation has to happen before or after you enter the code, using a separate tool. Problems surface later in Google Merchant Center or marketplace syncs.
Why is my Shopify product disapproved for an invalid GTIN in Google?
Google maps the Shopify barcode field to the gtin attribute. If the barcode has a wrong check digit, the wrong digit count (often a leading zero lost in a spreadsheet), or is a fabricated placeholder, Google returns “Invalid value [gtin]” and disapproves the item. Fix the barcode, or if the product genuinely has no GTIN, set identifier_exists to no instead of inventing one.
What is the difference between a UPC, an EAN, and a GTIN?
GTIN is the umbrella term for retail product numbers. UPC-A (12 digits, GTIN-12) is used in the US and Canada. EAN-13 (13 digits, GTIN-13) is used internationally. They share the same check-digit system, so a UPC is really just a shorter GTIN. Shopify accepts all of them in the same barcode field.
Can I make up my own barcodes for Shopify?
You can type anything into Shopify, but a made-up barcode fails everywhere it is actually read: Google Shopping, Amazon, eBay, and physical scanners. For products that need a real GTIN, buy a GS1 company prefix. For products that legitimately have none, mark them as having no identifier rather than fabricating one.
Why did my barcode lose a digit in the CSV?
Spreadsheets treat a barcode as a number by default, and a leading zero on a UPC-A gets dropped, turning 12 digits into 11. Always format the barcode column as text before pasting or importing. This is the most common cause of “invalid barcode” errors in Shopify CSV imports.
Related reading
- Shopify Google Shopping feed optimization
- Free Barcode & UPC Validator tool
- Shopify CSV validator
- Product CSV generator
- Rubik Variant Images FAQ for clean variant photos in your feed
- Separate products vs variants for SEO
The barcode field is the kind of thing that feels done the moment you paste something in it. It is not done until the number is real and the check digit matches. Ninety seconds of validation now saves a disapproval you would otherwise discover three months from now, wondering why one of your best products never shows up in Shopping.