Check and fix UPC codes
The CSV download keeps leading zeros when opened in Excel. Copied codes keep one line per pasted line; anything to check is left blank.
Why it happens
Spreadsheets treat a column of digits as numbers. Numbers don't have leading zeros, so Excel and Google Sheets quietly drop them, and very long numbers are shown in scientific notation. The UPC 036000291452 becomes 36000291452, which is no longer a valid barcode. Print it anyway and a scanner reads a different code, or nothing.
How the fix decides
- One or two missing zeros are restored when the restored 12-digit code has a correct check digit, which is how spreadsheets usually damage UPCs.
- When three or more zeros would be needed, the result is shown as a suggestion to check against the product, because about one random number in ten would also pass the check digit.
- An 11-digit code that doesn't validate with a zero in front may be missing its check digit. The calculated check digit is offered as a suggestion, not applied as a fix.
- Values with a tab in them are two spreadsheet cells pasted together; paste a single column instead.
- Scientific notation like
3.6E+10has already thrown digits away. Those can't be recovered: export again with the column formatted as Text. - A 12-digit code with the wrong last digit is flagged with the digit it should have. Check it against the product before you change it.
Stop it happening again
- Before pasting or importing codes, select the column and set its format to Text (Excel: Format Cells > Text; Google Sheets: Format > Number > Plain text).
- When opening a CSV in Excel, import it through Data > From Text/CSV and set the code column to Text, rather than double-clicking the file.
- Or skip the spreadsheet: paste your export straight into the label maker, which keeps codes as text and checks every one.