Skip to content

Leading zero

A leading zero is a 0 at the start of a code, such as a barcode, which spreadsheets often delete because they mistake the code for a number.

What it means

Plenty of codes start with a zero: barcodes, part numbers, a supplier’s own references. To a person the zero is part of the code. A spreadsheet that thinks it is looking at a number treats a zero at the front as meaningless and drops it. Microsoft says plainly that Excel “automatically removes leading zeros”.1

The damage is silent. A 12 digit UPC becomes 11 digits, a supplier code 00471 becomes 471, and nothing on screen says anything changed.

Prevention is easier than repair. Set code columns to Text before any data goes in, because formatting them afterwards “will not change numbers that have already been entered”.1

Think of it like this

It is like writing down a phone number without the 0 at the front. Every other digit is right, and the call still goes nowhere.

For example

A supplier sends the UPC 012345678905. After a trip through a spreadsheet it reads 12345678905, eleven digits instead of twelve. Because a leading zero never changes a barcode’s check digit, you can put the zero back and confirm the number with the check digit sum.

Why it matters

A barcode that has lost its zero is the wrong length. Google Merchant Center takes GTINs of 8, 12, 13 or 14 digits, so an 11 digit UPC raises an Invalid value [gtin] issue.2 A code missing its zero also stops matching the same product in every other file.

Not to be confused with

A lost leading zero differs from scientific notation. The zero can be put back, whereas a barcode turned into 5.01235E+12 has lost digits that no formula can recover.

Sources

  1. Microsoft Support. Keeping leading zeros and large numbers.
  2. Google Merchant Center Help. How to fix: Invalid value [gtin].

Now try it onyour own file

Nothing goes live without your sign-offEvery value keeps its sourceYour data is never shared

Send us one supplier spreadsheet exactly as it arrived. We will show you the same products before and after, with a source on every value we add.

One email with the upload link. Nothing else lands in your inbox.