Skip to content
FileMoat

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

  1. In a blank workbook, go to Data → From Text/CSV and pick your file.
  2. Click Transform Data.
  3. 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

ProblemCauseFix
02134 → 2134Value treated as a numberImport as Text, or convert to .xlsx
1234567890123456 → 1.23457E+1515-digit precision limitKeep as Text
12,5 shown as text or a dateDecimal separator mismatchConvert 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.