Convert Excel to CSV Without Losing Leading Zeros
Table of Contents
You convert your Excel file to CSV. You open it. Phone number "001-555-0123" is now "1-555-0123". Product code "00789" became "789". ZIP code 07030 is 7030. Your data is corrupted.
This is one of the most common complaints about Excel-to-CSV conversion, and it has a specific cause — and specific ways to avoid it. Here's what's actually happening and what you can do about it.
Why Leading Zeros Get Dropped in CSV Conversion
Leading zeros disappear because of how Excel stores numbers. When you type "007" into an Excel cell, Excel asks itself: is this a number? If yes, it stores the numeric value 7 — and the leading zeros are formatting, not data. The actual stored value is 7.
When that cell gets converted to CSV, the converter writes what's stored: 7. The leading zeros were never really there to begin with. They were display formatting applied on top of the number 7.
The CSV format has no concept of cell formatting. It's plain text. So whatever was stored — the raw value — is what gets written. For numbers stored as 7, you get "7". For numbers stored as "007" (as text), you get "007".
This is an important distinction: the problem is usually in your Excel file, not the converter. If the data is stored as a number in Excel, no converter can recover the leading zeros — they were already gone before conversion started.
Text Cells vs. Number Cells — The Key Difference
Excel has two ways a cell can store "007":
- As a text string: The cell value is literally the three characters "0", "0", "7". This is what you get when you import data with leading zeros using "Text" column type, or manually format the cell as Text before entering the value. Converting this to CSV preserves "007" perfectly.
- As a number with custom formatting: The cell stores the number 7, and a custom number format like "000" displays it as "007". The display looks right in Excel, but the stored value is 7. When converted to CSV, you get 7.
You can check which type a cell is by looking at the cell format (right-click → Format Cells). If it says "Number" or "General" with a custom format code, the leading zeros are display-only. If it says "Text," the leading zeros are stored data.
Sell Custom Apparel — We Handle Printing & Free ShippingHow to Preserve Leading Zeros Before You Convert
The best fix is to convert the relevant Excel columns to Text before exporting to CSV. Here's how:
- Select the column(s) with leading zeros (ZIP codes, product codes, phone numbers, employee IDs).
- Right-click → Format Cells → Number tab → select "Text" → click OK.
- Now re-enter or paste the values in that column. Yes, you have to re-enter them — changing the format doesn't retroactively convert stored numbers to text.
- A quicker approach: copy the column, open Notepad, paste there (this strips formatting), then paste back into Excel into a Text-formatted column.
If you're importing data into Excel from an external source (CSV, database dump, API export), Excel's import wizard lets you set the column type to Text before the data loads. Use this for any column that should preserve leading zeros.
Once the column is genuinely stored as Text in Excel, the Excel to CSV converter will preserve those values exactly as they appear.
Special Characters: Accents, Chinese, Arabic, and Unicode
The other common corruption issue is special characters. You have Spanish names with accent marks (José, González), Japanese product names, or Arabic customer records. After conversion, they appear as question marks or garbled text.
This is an encoding issue. The good news: modern browser-based tools output UTF-8 by default, which handles virtually all Unicode characters correctly. Accented Latin characters, CJK characters, Arabic script, emoji — all preserved.
The problem usually appears after conversion, when you open the CSV in Excel. Excel on Windows defaults to Windows-1252 encoding when opening CSV files, which misreads UTF-8 text as garbage. The data in the file is fine — Excel is just reading it with the wrong decoder.
Fix: don't double-click the CSV to open it in Excel. Instead, open Excel → Data → Get External Data → From Text → navigate to your file → select "Unicode (UTF-8)" in the import wizard.
Or just use the CSV in your target system directly (Salesforce, Mailchimp, Python, database import) rather than reopening in Excel — most modern systems handle UTF-8 correctly by default.
Scientific Notation: When "1.23E+15" Appears
One more data corruption case worth knowing: very large or very small numbers sometimes convert to scientific notation. A 15-digit order number like 123456789012345 appears in the CSV as "1.23456789012345E+14".
Same root cause: Excel stored the value as a floating-point number, and CSV just writes the stored value. Long numbers stored as numbers rather than text will hit this issue.
Prevention is the same as with leading zeros: store long numeric IDs as Text in Excel, not as numbers. Once stored as Text, they convert to CSV exactly as-is.
If you're receiving Excel files from external sources and can't control the source format, the most reliable fix is to open the original CSV in a text editor, find the scientific-notation values, and manually correct them. Or better: ask the sender to export the data with those fields explicitly formatted as Text in Excel before sending.
The main Excel to CSV guide has additional format tips for common edge cases.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free Excel to CSV ConverterFrequently Asked Questions
Why do ZIP codes and phone numbers lose leading zeros when converting Excel to CSV?
Excel stores those values as numbers (e.g., the number 7030, not the string "07030"). When converted to CSV, the number 7030 is written without leading zeros because they were never actually stored. The fix is to ensure those cells are formatted as Text in Excel before entering the data — or before converting.
Does the browser-based converter preserve UTF-8 characters?
Yes. Browser-based tools output UTF-8 by default, which correctly handles accented characters (é, ü, ñ), CJK characters, Arabic, and most other Unicode text. If special characters appear garbled after conversion, the issue is usually how you're opening the resulting CSV — not the conversion itself.
Can I recover leading zeros that were already lost in the Excel file?
Not automatically. If the leading zeros were never stored (only displayed via cell formatting), no converter can recover them — the raw data is just the number. You'd need to manually pad the values back. Going forward, store numeric IDs, ZIP codes, and similar fields as Text in Excel to prevent this.
Why do large numbers appear in scientific notation in my CSV?
Long numbers stored as numeric values in Excel get written in scientific notation when converted to CSV. IDs, order numbers, and barcodes longer than 15 digits are especially affected. Store those columns as Text in Excel to preserve the full numeric string exactly.

