Skip to content

Guides

Leading zeros dropped from SKUs and UPCs

You double click a supplier CSV. Excel opens it, sees a column of digits, and decides it is a column of numbers. From that moment 0012345 is the number 12345, and the two leading zeros are gone from the file you save. Square imports what the file says, so the SKU in your catalog no longer matches the label on the shelf.

The same cause produces two different symptoms

  • Short codes lose their leading zeros. 0012345 becomes 12345 and scans as a different product, or as nothing at all.
  • Long codes become scientific notation. 268435456789012345 becomes 2.68435E+17, and the digits past the sixth no longer exist in the file.

Square names both in its troubleshooting article and both are properties of the spreadsheet program, not of Square and not of the supplier. The supplier file was correct when it was sent.

Do not open the CSV

The reliable answer is to stop opening the file at all. Square recommends the .xlsx format over .csv for any catalog that carries SKUs, because an .xlsx cell remembers that it is text. If you must work in Excel, import the CSV through Data, then From Text, and set the SKU and GTIN columns to Text before the data lands.

Read the file without touching it

Drop the original CSV below. It is read as text from the first byte, so a leading zero is still a leading zero when it reaches the SKU column, and the download is an .xlsx with the SKU and GTIN cells typed as text.

Loading the tool

What can and cannot be recovered

A code that lost a leading zero can often be rebuilt, because barcodes have fixed lengths and a check digit to test the guess against. A code that became scientific notation cannot. The digits were rounded away, and no rule reconstructs them. When that has happened the honest fix is to ask the supplier for the file again and to read it without opening it.

original csv cell      0012345
opened in a spreadsheet  12345
read as text           0012345
The same SKU through three paths

Duplicate SKUs deserve one more minute. Two products sharing a code is not rejected by Square, so it lands quietly and then confuses every stock count, every sales report and every reorder decision that follows. Group them before the import and give the newer product its own code.