Excel removes leading zeros because it treats any value made only of digits as a number. To keep them, either import the CSV with the column set to Text, or convert the CSV into a real Excel file that stores those values as text. Our free CSV to Excel converter does the second one automatically: 00123 stays 00123, and normal numbers still work as numbers.
Below are three methods, what each one is good for, and the one mistake that makes the zeros impossible to recover.
Why the zeros disappear
A CSV file is plain text. It does not say "this column is a ZIP code" or "this column is a product code". When you double-click a CSV, Excel opens it and guesses a type for every cell. A value like 00123 looks like a number, so Excel stores it as 123. The same thing happens to:
- ZIP and postal codes such as 02134
- Employee, customer and order IDs such as 000457
- Bank sort codes, account numbers and phone numbers that start with 0
- Product codes such as 0012-A (these usually survive because of the letter, but not always)
The important part: the zeros are still in your CSV file. Open it in a plain text editor and you will see them. They are lost only in the sheet Excel created. If you save that sheet back over the CSV, then they are gone for good.
Method 1: convert the CSV to Excel in your browser (fastest)
- Open the CSV to Excel converter.
- Choose or drop your CSV, TSV or TXT file (up to 50 MB). You can also paste data into the box.
- Check the preview of the first 100 rows. Your codes show with their zeros.
- Leave "Save numbers as numbers (Excel and JSON). Leading zeros are always kept." ticked if you want amounts and quantities to stay summable. Untick it to keep every value as text.
- Click Download Excel.
What the converter does with each value, exactly:
| Value in your CSV | Saved in the Excel file as | Why |
|---|---|---|
00123 | text 00123 | starts with 0 followed by a digit |
-012 | text -012 | same rule, with a minus sign |
0.75 | number 0.75 | a zero before the decimal point is a normal number |
1,250 | number 1250 | thousands separators are understood |
4111111111111111 | text | 16 characters or longer is always kept as text, so long IDs keep every digit |
2026-12-05 | text | dates are left exactly as written |
$99 or 15% | text | symbols are left as you wrote them |
The file is read and written inside your browser. Nothing is uploaded, which matters when the CSV holds customer or payroll data.
Limits to know: one Excel sheet holds at most 1,048,576 rows (Microsoft's published limit, see Excel specifications and limits). If your CSV is longer, keep it as CSV or convert it to JSON instead.
Method 2: import the CSV inside Excel with the column set to Text
If you need to stay inside Excel, do not double-click the file. Microsoft's own guidance (Keeping leading zeros and large numbers) is to import it:
- Open a blank workbook.
- Go to Data > From Text/CSV and pick your file.
- In the preview, choose Transform Data (this opens Power Query).
- Select each column with leading zeros, then set its data type to Text.
- Click Close & Load.
This works well, but you have to remember which columns need it every time, and it is easy to miss one in a wide file.
Method 3: Google Sheets
In Google Sheets, use File > Import, upload the CSV, and untick the option that converts text to numbers, dates and formulas. Every value then arrives as text. That keeps the zeros, but it also turns amounts into text, so you may need to convert some columns back to numbers before you can total them.
Which method should you use?
| You want to | Use |
|---|---|
| A one-off Excel file with zeros kept and numbers still summable | Method 1 |
| A repeatable import you refresh inside the same workbook | Method 2 |
| To work in Google Sheets only | Method 3 |
| JSON for an app or script, with IDs kept as strings | Our CSV to JSON converter, which applies the same zero rule |
Files that use semicolons, tabs or pipes
Not every "CSV" uses commas. Excel in many European countries saves CSV files with semicolons, because the comma is the decimal mark there, and some systems export tab or pipe separated text. The converter tests the first rows of your file with comma, tab, semicolon and pipe, and picks the one that splits the rows into the same number of columns most consistently. A file ending in .tsv is always read as tab separated.
The first non-empty line is used as the header row. If the preview shows a report title or a note as the header, delete the lines above the real header in a text editor and convert again. Empty header cells are named by position, such as column_3, and a repeated name gets a number, such as Amount_2, so every column can be told apart.
Going the other way: Excel to CSV
The reverse problem is common too. If your Excel sheet already shows 00123 as text, our Excel to CSV converter writes it to the CSV unchanged. The CSV will still look wrong if you then double-click it in Excel, for the reason above, so import it with Method 2 or keep working from the Excel file.
A quick check before you share the file
Open the converted file and sort the code column. If codes of different lengths sort as 1, 10, 100, 2, they are text, which is what you want for IDs. If they sort as 1, 2, 10, 100, Excel treated them as numbers somewhere along the way.
Frequently asked questions
Why does Excel remove leading zeros from my CSV?
A CSV has no column types. When you double-click it, Excel guesses that any value made only of digits is a number, and numbers do not keep zeros in front. The zeros are still in the CSV file; Excel drops them on opening.
Can I get the zeros back after Excel removed them?
Not reliably from the opened sheet, because Excel stored the value as a number. Go back to the original CSV and convert or import it again with the column set to text.
Will the converter turn my real numbers into text too?
No. By default, values like 42, 3.5 or 1,250 are saved as real numbers you can add up. Only values that start with a zero, or are 16 characters or longer, are kept as text. You can also untick the number option to keep every value as text.
Is my CSV uploaded?
No. The CSV to Excel converter runs in your web browser and the file never leaves your computer.
What if my CSV uses semicolons or tabs?
The converter detects commas, tabs, semicolons and pipes automatically, so the columns line up without any settings.
More free tools for cleaning files are on the tools page. Spotted an error? Write to dealmahal.official@gmail.com.
Questions or corrections: dealmahal.official@gmail.com.