Shopify import fix

Shopify: Barcode is invalid

The barcode column contains something that is not a valid GTIN, or the same barcode appears twice in the store.

How to fix it

  1. Check that each barcode is 8, 12, 13 or 14 digits with no spaces or hyphens.
  2. Verify the check digit; a single wrong digit makes it invalid.
  3. Search the store for a product already using that barcode.
  4. Leave Barcode empty for variants that genuinely have none.

How to avoid it next time

Validate barcodes at the source. One wrong check digit fails the whole row.

Catch these before the import runs

The free Shopify CSV checker names the exact line for each problem. The paid Rescue Kit adds 20 more error cases, a template in Shopify's column order, and the same checker as a script for your pipeline.

See the Rescue Kit →

A GTIN is not an arbitrary string of digits. The last digit is a check digit, computed from all the others with a weighted sum. That is how a scanner knows a barcode was read correctly.

The algorithm. Working right to left from the digit before the check digit, multiply alternating digits by 3 and 1, sum them, then subtract the sum from the next multiple of ten. For 0012345678905 the digits before the check are 001234567890; weighting from the right gives a total of 185, the next multiple of ten is 190, so the check digit must be 5.

Why valid-looking codes fail. A single mistyped digit fails the sum but the length still looks right, so the error reads as "invalid barcode" rather than "wrong digit". A code that also appears on another variant fails for a different reason — uniqueness, not arithmetic.

Why Excel makes this worse. A 13-digit number exceeds Excel's precision for display in some locales, and any leading zero in a 12-digit UPC is stripped. Both produce a barcode that is the wrong length before any validation runs.

Questions

How long should a GTIN be?

8, 12, 13 or 14 digits. Anything else is not a GTIN regardless of the check digit.

My barcode is valid but Shopify still rejects it — why?

Most likely another variant already uses that exact code. GTINs must be unique per variant.

Do I need a barcode at all?

No. Leave the column empty for products that genuinely have none; a wrong code is worse than none.