Skip to content
CatalogRouteCatalogRoute
Sign in
Open the tool

Leading zeros dropped from SKUs and UPCs

Open a supplier CSV in Excel and it can strip the zeros from your product codes. What that does in Square, and how to avoid it.

You double click a supplier CSV and Excel opens it. Excel sees a column of digits and treats it as numbers, so 0012345 becomes 12345. When you save, the two zeros are gone. Square imports whatever is in the file, and now the SKU in your catalog no longer matches the label on the shelf.

What Excel does to codes

  • Short codes lose their leading zeros. 0012345 turns into 12345, which scans as another product or as nothing.
  • Long codes turn into scientific notation, Excel's short form for big numbers. 268435456789012345 becomes 2.68435E+17, and everything after the sixth digit is gone from the file.

Square's troubleshooting article lists both problems. Both come from the spreadsheet program. The file was fine when the supplier sent it.

Keep the CSV out of Excel

The safest fix is to leave the file closed. For any catalog with SKUs, Square recommends .xlsx over .csv, because an .xlsx cell remembers that it holds text. If you have to use Excel, bring the CSV in through Data, then From Text, and set the SKU and GTIN columns to Text before Excel loads the data.

Let the tool read the file

The Square tool reads the whole CSV as text, so a leading zero is still there when it reaches the SKU column. The file you download is an .xlsx with the SKU and GTIN cells stored as text.

Open the Square tool to try it with your own file.

What you can recover

You can often rebuild a code that lost a leading zero. Barcodes have fixed lengths and a check digit, so you can test your guess. A code that turned into scientific notation is lost. Excel rounded the digits away, and nothing brings them back. Ask the supplier to send the file again, and read it this time without opening it in a spreadsheet.

What happens to one SKU
original csv cell0012345
opened in a spreadsheet12345
read as text0012345

Look for duplicate SKUs too. Square accepts two products with the same code without a warning. From then on, stock counts, sales reports and reorders mix the two up. Group them before the import and give the newer product a code of its own.

Sources