Excel removed the leading zeros — get them back and keep them
Excel decides that 00412 is the number 412 while it opens the file, and shows it that way. The CSV on disk still says 00412 — until you save from Excel, at which point the zeros are gone from the file too. Postcodes, account numbers, product codes and anything with a fixed width are the usual casualties.
First, find out whether the zeros are still in the file
Open the file here rather than in Excel. The editor shows every value as the exact text in the file, so if you see 00412 the zeros were only hidden by Excel and nothing has been lost. If you see 412, the file itself was saved without them.
The sample on this page has a customer id column with leading zeros and a value stored as 1e3 — the two things Excel rewrites first.
Keep them: open and edit without Excel
The editor never turns a value into a number, so whatever you open, fix and download keeps its zeros, its long id numbers and its dates as written. That is the difference between an editor and a spreadsheet, and it is why this one has no formulas.
If the file must reach someone who will open it in Excel, convert it to a workbook here first: the converter writes each of these values as a text cell, which Excel shows as-is and never reinterprets.
Put them back when they are already gone
If the zeros were lost to a save and the codes have a known width, they can be restored: pad every value in the column to that width. The SQL console does this in one line — for a five-character id, lpad on the column — and the download keeps the padded values as text.
Codes of varying width cannot be reconstructed from the number alone; for those, the original export or the source system is the only way back.
The sample file
id,customer,order date,Amount,notes
00412,Sample Supplies Ltd,2025-01-04,150.00,
00413, Placeholder GmbH,04/01/2025,89.50,called twice
00413, Placeholder GmbH,04/01/2025,89.50,called twice
00414,demo traders,2025-02-11,N/A,
00415,Demo Traders,2025-02-30,32.10,date looks wrong
00416,Fictional Foods ,,NULL,amount missing
00417,NOTREAL NETWORKS,2025-03-02,1e3,stored as scientificObviously made-up data, small enough to read. Download it and drop it on the tool to see the fix before trying your own file.
Questions
- Are the zeros gone the moment Excel opens the file?
- From the display, yes; from the file, no. The CSV on disk is untouched until you save from Excel. Check the file here before assuming anything is lost.
- Can I make Excel keep them?
- Only by importing rather than opening: Data, then From Text/CSV, and setting the column to Text before loading. It works, and it has to be done again for every file. A workbook with text cells, made here, needs no such step.
- What else does Excel change on open?
- Anything that looks like a date (SEPT2, 1/2, 2024-03), long numbers past fifteen digits which are rounded and shown as 1.23E+15, and values like 1e3 which become 1000. The same rule protects all of them here: nothing is retyped.
- Do the zeros survive converting to Excel format?
- Yes. The CSV to Excel converter writes values such as 00412 as text cells, so Excel shows them exactly and does not turn them into numbers, even when the workbook is opened and saved again.
- How do I restore zeros to a column that lost them?
- When every code should have the same width, pad the column back to that width in the SQL console and download the result. When the widths varied, the padding cannot know which values had zeros, so the original data is needed.
- Is my file uploaded anywhere?
- No. The editor opens the file as the text it is, on your own machine — which is precisely why the zeros survive. Keep your developer tools’ Network tab open while you work: every request in it goes to this site itself, and none carries your file.