Book a demo

Your barcodes lost their leading zero

A UPC-A has 12 digits and many start with 0. Store it as a number and the zero disappears, leaving 11 digits that Google, OpenAI and other retailers can't match. The check digit still works, which is why the fault hides. Put the 0 back, store barcodes as text, and check the whole column with a free GTIN checker.

Open your product export and sort the barcode column by length. If some codes have 11 digits, they are almost certainly UPCs that lost their leading zero. Every system downstream, from Google Shopping to an AI shopping agent, now sees a code that matches nothing.

How does a barcode lose its leading zero?#

A UPC-A has 12 digits, and a large share of them start with 0. To a spreadsheet or a database field typed as a number, 036000291452 and 36000291452 are the same value, so it keeps the shorter one.

It happens in a few familiar places:

  • A CSV opened in Excel and saved again. Excel reads the column as numbers and writes them back without the zero.
  • An ERP, POS or supplier portal field set up as an integer.
  • An import mapping that converts text to a number on the way in.
  • A longer code shown as 9.30063E+12. Save the file in that state and the last digits are gone too.

None of these looks like an error at the time. The column still holds digits, and nobody reads every barcode.

Why does the check digit still pass?#

The last digit of every GTIN is a check digit worked out from the others. GS1 publishes the method:

  1. Take the digits before the check digit.
  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 amount needed to reach the next multiple of 10.

For 036000291452, the first 11 digits are 0 3 6 0 0 0 2 9 1 4 5. From the right that gives 5×3 + 4×1 + 1×3 + 9×1 + 2×3 + 0×1 + 0×3 + 0×1 + 6×3 + 3×1 + 0×3 = 58. The next multiple of 10 is 60, so the check digit is 2.

The weights start from the right, so a zero on the left adds nothing to the sum. 36000291452 passes the same arithmetic. That is why the fault survives: a check-digit test alone says the code is fine, and only the length gives it away.

Why does a missing zero matter to AI shopping agents?#

Shoppers now ask ChatGPT, Gemini and Perplexity what to buy, and those assistants answer from product data. To recommend your listing they need to know it is the same product another retailer sells, and the barcode is how they tell.

The published specifications are explicit. Google Merchant Center asks you to "make sure that the check digit is present and correct" and warns that products with a missing or incorrect GTIN "may have limited visibility". OpenAI's product feed asks for a GTIN of exactly 8, 12, 13 or 14 digits, "including a valid check digit", and tells merchants to "keep identifiers as strings to preserve leading zeros".

An 11-digit barcode fails both. The listing falls back to being matched on its title, which is a guess.

This is why the barcode carries the most weight in twelfth's agent readiness score. It is the one field that makes your listing the same product as a competitor's.

What it looks like in a real range#

We scored a demo range of 1,240 lines for agent readiness. 98 lines failed the barcode check, and all 98 had the same cause: 11-digit numeric codes that become valid UPCs once a 0 goes back in front.

Every one passed the GS1 check once the zero was back, so the fix was the same for all 98: restore the zero and store the field as text.

How to fix barcodes across a whole range#

  1. Export the barcode column and paste it into the free GTIN checker. It checks each code as a GTIN-8, 12, 13 or 14 and returns the repaired 12-digit code for every UPC that lost its zero.
  2. Copy the results into your spreadsheet. Each row keeps the code you pasted next to the code to use.
  3. Fix the field at its source. Change the barcode field to text in the system that feeds the others (usually the ERP or POS), then update the codes there.
  4. Re-export your product feed and check it again. Do not open the CSV in Excel on the way, or the zeros go again. Import it with the column set to text.

The checker runs in your browser, so a supplier list or a full range never leaves your machine.

What other barcode failures should I check for?#

Lost zeros are the most common fault, but not the only one:

  • Wrong check digit. Usually a typo or two digits swapped. The checker shows the digit the code should end in, but only use it if you know the rest is right. Otherwise take the code from the pack.
  • Scientific notation. A code shown as 9.30063E+12 has lost its last digits. Export it again from the source.
  • A SKU in the barcode field. Letters, dashes or an odd length usually mean an internal code was put where the GTIN belongs. Send it as the SKU or MPN instead.
  • Store-internal codes. Codes starting with 2, or 02 and 04 as a UPC, are for use inside one business. Google Merchant Center will not accept them, even with a correct check digit.

A valid check digit tells you the code is well formed. It does not prove the code is yours. For that, GS1's Verified by GS1 service shows which company a barcode was issued to.

Frequently asked questions

Why does my UPC only have 11 digits?
Because a spreadsheet, CSV import or number field treated it as a number and dropped the leading zero. A UPC-A always has 12 digits. Put the 0 back in front and store the column as text.
How do I calculate a GS1 check digit?
Take the digits before the check digit. Starting from the right, multiply them by 3, 1, 3, 1 and so on, and add the results. The check digit is the amount needed to reach the next multiple of 10, or 0 if the sum already is one.
Is an 11-digit barcode with a 0 added always correct?
Only if the check digit passes once the 0 is in front, and only if the code was right before it was stored. A valid check digit means the code is well formed, not that it belongs to your product. GS1's Verified by GS1 service shows who a barcode was issued to.
Do AI shopping agents use barcodes?
Yes. Agents and the feeds behind them match the same product across retailers on its GTIN. Google Merchant Center asks for a correct check digit, and OpenAI's product feed asks for a valid GTIN with leading zeros preserved.
Is UPC the same as GTIN?
A UPC-A is a GTIN-12, and an EAN-13 is a GTIN-13. Both are GTINs, and feeds accept either.

Sources

  1. How to calculate a check digit manually, GS1
  2. Check digit calculator, GS1
  3. GTIN [gtin], Google Merchant Center Help
  4. Product feed schema, OpenAI
  5. Merchant listing (Product, Offer) structured data, Google Search Central

GTINbarcodesUPCproduct dataAI shopping agents

Was this article useful?

About the author

· Co-founder and CTO

Michael leads engineering at twelfth: the AI agents, the retail data behind them, and security.

Read next

AI shopping agents4 min read

ChatGPT product feed vs Google Merchant Center: one field list

OpenAI's product feed and Google Merchant Center need the same core facts: ID, title, description, page, image, price, availability, brand and, where it exists, a GTIN. Hold each one once, to Merchant Center's stricter limits, and both feeds come out of the same record. The differences are field names, a few values and OpenAI's seller and market fields.

By Michael Carter

AI shopping agents3 min read

Free: an AI visibility checker for product pages

Paste a product page URL and the free checker grades its schema.org Product markup against Google's and OpenAI's published specs, out of 100, and gives you the JSON-LD to add. The same check runs as one MCP tool, check_product_page, at twelfth.ai/tools/mcp. Neither needs an account.

By Michael Carter

AI shopping agents3 min read

Product schema for AI agents: the 13 fields that matter

An agent-ready product page carries one schema.org Product in JSON-LD, in the HTML the server sends, with a name, an image and an Offer that states price, currency and availability. Brand, GTIN, description, MPN, SKU, shipping, returns and real ratings complete it. The template below has all thirteen.

By Michael Carter

Next step

Check your barcodes in a minute.

Paste a column of barcodes into the free GTIN checker. It flags every code that fails, repairs the ones that lost their leading zero, and runs in your browser, so nothing is uploaded.

Request a topic

What should we write about?

Ask a question about retail, pricing, range, forecasting or AI. The team reads every request and picks the next articles from them. Or email hello@twelfth.ai.

Readers ask things like

No bad cookies on these shelves.

Essential cookies keep the store running. Analytics only if you choose.