How to Preserve Leading Zeros in Excel
Keep leading zeros in UPCs and SKUs when entering codes, importing CSV files, and preparing barcode labels.

Enter 00123 into a cell formatted as General and Excel can store it as 123. For an identifier, those two values can refer to different records. Store barcodes and SKUs as text, and keep quantities in a separate numeric column. Microsoft’s guide to keeping leading zeros
Set the format before entering codes
- Select the entire UPC or SKU column in a blank sheet.
- On the Home tab, select Text from the number format menu.
- Paste or enter the values. Select a row with a leading zero and confirm the complete value appears in the formula bar.
Changing an existing numeric cell to Text leaves its current value in place. If the zeros are already missing, go back to the original product list or supplier file. A custom number format can display 00123 in Excel while the stored number is still 123. Microsoft’s guide to formatting numbers as text
Import a CSV without losing zeros
- In desktop Excel, use Data → From Text/CSV and select the file. Some versions place the command under Get Data.
- Open the preview in Power Query using Transform Data or Edit. Set identifier columns to Text before loading. If Power Query added a Changed Type step that converted a column to numbers, edit or remove that step to use the original values.
- Check a few known identifiers in the loaded table, including one that begins with zero, then save your working copy as
.xlsx.
Opening a CSV directly lets Excel infer column types. If you need to deliver a CSV, open the exported file in a plain-text editor and check the characters in the file before passing it on. Microsoft’s text and CSV import guide
Check the values before printing
Upload the file in Bulk Barcode, map the identifier column to Barcode value, and compare a few rows with your source. If an assigned 12-digit UPC has lost its opening zero, the remaining 11 digits might look like a UPC whose check digit is missing. The generator can calculate a final check digit from 11 digits, so a valid preview alone cannot reveal a missing first digit. Correct the row against your product records before exporting.