Guide
Opening a CSV in Excel without losing leading zeros
Excel turns 02134 into 2134 and long IDs into 1.23E+15 when it opens a CSV. Here is why, and three ways to keep your codes and numbers intact.
Updated 1 October 2026 3 min read
Open a CSV in Excel and zip code 02134 becomes 2134, product code 00789 becomes 789, and a 16-digit card or account number turns into 1.23457E+15 — with the last digits replaced by zeros. Save the file, and the damage is permanent.
Why it happens
When you double-click a CSV, Excel guesses the type of every value. Anything that looks like a number is stored as a number — and numbers have no leading zeros. Excel also keeps only 15 significant digits, so longer numbers lose their end.
Fix 1 — Import instead of opening
- In a blank workbook, go to Data → From Text/CSV and pick your file.
- Click Transform Data.
- Select the affected columns, set their Data Type to Text, then Close & Load.
It works, but you have to remember it every time and choose the columns yourself.
Fix 2 — Convert the CSV to a real .xlsx first
An .xlsx file stores the type of each cell, so Excel doesn't have to guess. A good converter keeps values with leading zeros and very long numbers as text, while turning genuine amounts into real numbers you can sum.
Fix 3 — Watch out for decimal commas
In much of Europe, CSVs use a semicolon between columns and a comma in decimals (12,5). Opened with an English setup, 12,5 can become text — or a date. Converting with a tool that understands both formats avoids the guesswork.
Quick reference
| Problem | Cause | Fix |
|---|---|---|
| 02134 → 2134 | Value treated as a number | Import as Text, or convert to .xlsx |
| 1234567890123456 → 1.23457E+15 | 15-digit precision limit | Keep as Text |
| 12,5 shown as text or a date | Decimal separator mismatch | Convert with a locale-aware tool |
Frequently asked questions
Can I get the zeros back after opening the file?
You can display them with a custom number format such as 00000, but the cell still holds a number. Long numbers that lost their last digits cannot be recovered — re-import the original CSV instead.
Does Google Sheets have the same problem?
Yes, by default. When importing, set “Convert text to numbers, dates and formulas” to No to keep values exactly as they are.
Should I just save my CSV as .xlsx?
Only after the data was imported correctly. Saving a file in which Excel already removed the zeros keeps the damage.