Skip to content
Guide

How to convert a CSV to Excel without losing leading zeros, dates or accents

To convert a CSV to Excel, do not double-click the file. Import it through Data, From Text/CSV, use a CSV to XLSX converter, or open it in Google Sheets and download it as Excel. Each of these lets you keep ZIP codes, long IDs and dates as they were. This guide explains why Excel mangles CSV files and walks through each method, plus how to clean up and go back to CSV.

Updated November 9, 2026 · 8 min read

What is a CSV file, and why does Excel mangle it?

A CSV is a plain text file. Each line is a row, and the values in the row are separated by commas (or semicolons, or tabs). There is no formatting, no formulas, no sheets and, importantly, no information about what type each column is. When Excel opens one, it has to guess, and it guesses the same way it does when you type into a cell.

That guessing is what causes the damage. A ZIP code like 02134 becomes 2134 because Excel treats it as a number and drops the leading zero. A 16-digit card number or tracking ID turns into 4.52E+15 and the digits past the 15th are replaced by zeros for good. A value like 3/4 becomes March 4, and product codes such as MARCH1 or SEPT2 become dates too. Accents from a UTF-8 file show up as é when Excel assumes the wrong encoding. And a CSV exported from European software or some banks uses semicolons, so Excel in a US setup dumps every row into column A.

None of this is in the file. The data is intact until Excel interprets it, so the fix is always the same: tell Excel what the columns are instead of letting it guess.

Convert CSV to Excel online

If you want an XLSX file and not a long import dialog, use CSV to Excel. It turns a CSV into a tidy XLSX with real numbers and dates, a bold header row and filters already turned on, so the result opens ready to sort and sum. It is free, needs no sign-up and runs in the browser on a phone or computer; files up to 300 MB and up to 50 files per batch are accepted, processed in memory and deleted after 30 minutes.

Whatever converter you use, open the result and check the columns that matter most: ZIP codes, phone numbers, IDs and dates. A quick glance at the first and last rows catches most problems before the file goes anywhere.

  1. Open CSV to Excel and add one CSV or a whole batch.
  2. Run the conversion and download the XLSX files.
  3. Open a file and look at the ZIP, phone, ID and date columns. Click a date cell: a real date shows in the formula bar as a date, while text shows exactly as typed.

Import with Data, From Text/CSV in Excel

Excel's own import route gives you control over every column. It works in Excel for Microsoft 365 and Excel 2016 and later on Windows, and in recent versions of Excel for Mac. Start from a blank workbook, not from the CSV.

The key setting is Data Type Detection. The default, Based on first 200 rows, is where leading zeros disappear. Choosing Do not detect data types imports every column as text, which is safe but means you convert the number columns yourself afterwards. The middle path is Transform Data, which opens Power Query where you can right-click each column, choose Change Type, and set ZIP codes to Text, amounts to Decimal Number and dates to Date.

  1. Open a blank workbook. On the Data tab, click Get Data, From File, From Text/CSV (on Mac, Data, From Text/CSV) and pick the file.
  2. In the preview, set File Origin to 65001: Unicode (UTF-8) if accents look wrong.
  3. Check Delimiter. If everything sits in one column, change it from Comma to Semicolon or Tab.
  4. Set Data Type Detection to Do not detect data types, or click Transform Data to set each column's type by hand.
  5. Click Load. The data lands on a new sheet as a table. Save with File, Save As and choose Excel Workbook (.xlsx).

The Text Import Wizard and Text to Columns

Older versions of Excel have the Text Import Wizard instead, and it is still available in new versions under File, Options, Data, Show legacy data import wizards. It walks through three steps: Delimited, pick the delimiter, then Column data format, where you click each column and choose Text for anything that must keep its zeros, and Date with the right order (MDY for US exports, DMY for most others) for date columns.

If you already opened the CSV and everything is in column A, select the column, click Data, Text to Columns, choose Delimited, tick the right delimiter and set the column formats on the last step. It cannot restore zeros that were already dropped, though; for that you need to re-import.

Open a CSV in Excel without losing leading zeros

Leading zeros are the most common complaint. The import methods above, with the ZIP or ID column set to Text, are the only way to preserve zeros that the CSV actually contains. Once Excel has opened the file by double-click and shown you 2134, the zero is gone from memory and saving the file makes it permanent.

If the column is a fixed length, you can rebuild the zeros instead. Select the column, press Ctrl+1, choose Custom and enter 00000 for five-digit ZIP codes. Excel displays the zeros while storing the number, so this is fine for printing but a lookup against a text ID elsewhere will still fail. The TEXT function does it as a formula: =TEXT(A2,"00000") gives you a text value with the zeros back. Quotes in the CSV do not help, by the way: "02134" with ordinary quotes is still read as a number by Excel.

Convert CSV to Excel with Google Sheets

Google Sheets imports CSV more gently than Excel and is a good route on a Chromebook or when you have no Excel installed. Open a blank sheet, click File, Import, Upload, and choose the CSV. In the import dialog, leave Separator type on Detect automatically unless the preview shows one column, and untick Convert text to numbers, dates and formulas if you want every value kept exactly as written. Click Import data.

Once it looks right, click File, Download, Microsoft Excel (.xlsx) to get an Excel file. Sheets also handles UTF-8 correctly by default, which makes it a quick fix for a CSV full of broken accents: import it, download it, done. Google Sheets does get slow on very large exports, which are better handled by Excel's import or a converter.

Fix the common problems after converting

Even a careful import leaves some cleanup. Numbers that arrived as text show a green triangle in the corner and refuse to add up; select the column, click the warning icon and choose Convert to Number, or multiply the column by 1 with Paste Special. Trailing spaces from the source system make lookups fail and duplicates invisible. Empty rows and duplicate records from a merged export need removing before any pivot table. Clean up spreadsheet handles these in one pass: it removes duplicates and empty rows, trims spaces, fixes numbers stored as text and tidies capitals.

Dates that imported as text can be converted with =DATEVALUE(A2) in a helper column, then formatted as a date. If days and months are swapped, the import used the wrong order; re-import with the column set to the correct date format rather than trying to fix it with formulas. For a CSV that came out of an old XLS or an ODS workbook, Convert spreadsheet format converts between XLSX, XLS, ODS and CSV directly.

Going back from Excel to CSV

Many systems only accept CSV, so the trip often runs the other way. In Excel, use File, Save As and choose CSV UTF-8 (Comma delimited). Excel saves only the active sheet, warns you that formatting and formulas will be lost, and writes dates in your regional display format, which is not what most databases want.

Excel to CSV saves each sheet of an XLSX as its own CSV, with ISO dates (2026-11-09) and plain numbers without thousands separators or currency symbols, which is the format most import tools, CRMs and accounting systems read without complaint. Before exporting, remember that a CSV stores what the cell contains, not how it looks, so a column that relies on a number format to show its zeros will lose them.

Frequently asked questions

How do I convert a CSV file to Excel?

Open a blank workbook, click Data, Get Data, From File, From Text/CSV, choose the file, check the delimiter and data types in the preview, click Load, then save as .xlsx. A free online converter such as DocGopher's CSV to Excel does the same and returns an XLSX with real numbers and dates, a bold header and filters.

How do I open a CSV in Excel without losing leading zeros?

Import the file with Data, From Text/CSV instead of double-clicking it, and set the ZIP or ID column to Text, either by choosing Do not detect data types or by setting the type in Transform Data. Once Excel has opened the file by double-click, the zeros are already gone.

Why does Excel put all my CSV data in one column?

The file uses semicolons or tabs instead of commas, which is common in exports from European software and some banks. Select the column and use Data, Text to Columns with the right delimiter, or re-import with Data, From Text/CSV and change the Delimiter setting.

Why do accents show as strange characters when I open a CSV in Excel?

The CSV is encoded as UTF-8 and Excel assumed a different encoding. Import it with Data, From Text/CSV and set File Origin to 65001: Unicode (UTF-8), or open it in Google Sheets, which reads UTF-8 by default, and download it as .xlsx.

Can I convert CSV to Excel on a Mac?

Yes. Recent Excel for Mac has Data, From Text/CSV with the same preview and type options as Windows, Numbers opens CSV files and exports to Excel, and an online converter works in Safari. Double-clicking the CSV has the same leading-zero problem on a Mac as on Windows.