CSV files open in Excel, but you need to use the correct method to avoid losing data

A CSV file (comma-separated values) is a plain-text format that stores data in rows and columns. When you double-click a CSV file on your computer, it usually opens in Excel automatically — but this shortcut can corrupt your data, especially if your spreadsheet contains numbers with leading zeros, long ID codes, or dates in unusual formats. Excel may silently convert or delete this information without warning you.

The safe way to open a CSV file in Excel is to use the Import function instead of double-clicking. This gives you control over how Excel interprets each column before the file loads. The process takes about two minutes and prevents data loss.

Key Takeaways

  • Double-clicking a CSV file can cause Excel to change or delete data like leading zeros and long numbers without asking you first.
  • The Import function (called "Get & Transform" in newer Excel versions) lets you preview and control how each column is read before opening the file.
  • You can also open Excel first, then use File > Open to browse for your CSV file, which triggers the same import dialog.
  • After importing, save the file as an Excel workbook (.xlsx) if you want to keep your formatting and formulas; CSV format does not store those.

How to import a CSV file using the Import function

Open Excel and go to the File menu at the top left. Click Open, then browse to the folder where your CSV file is stored. Find the file, click it once to select it, and click Open. Excel will show you a dialog box called the Text Import Wizard.

In the Text Import Wizard, you will see a preview of your data at the bottom of the screen. The wizard has three steps. On Step 1, make sure the File origin is set to 65001: UTF-8 (or the correct language for your file). Leave Delimiters set to Comma unless your CSV uses a different separator like a semicolon or tab. Click Next.

On Step 2, you can skip this screen unless you need to exclude certain columns. Most users click Next again. On Step 3, this is where you prevent data loss. Look at the column list on the left. Any column that contains numbers with leading zeros, long ID codes, or dates should be set to Text format instead of General. Click the column header in the preview, then change the Column data format dropdown at the top right to Text. Repeat for each column that needs protection. Click Finish when you are done.

Using the Get & Transform feature in newer Excel versions

If you have Excel 2016 or later, you can also use the Get & Transform feature, which is more powerful than the Text Import Wizard. Go to File > Open and select your CSV file. Instead of clicking Open directly, click the small arrow next to the Open button and choose Open and Transform.

This opens the file in the Power Query editor, where you can see every row and column before importing. You can delete unwanted columns, filter rows, and change data types for each column. When you are satisfied, click Close & Load in the top right. The data will load into your Excel workbook with all your settings preserved.

Get & Transform is especially useful if your CSV file is very large or contains messy data. However, it requires a bit more learning than the Text Import Wizard, so start with the wizard if you are new to this.

What to do if Excel opens your CSV file the wrong way

If you accidentally double-clicked your CSV file and Excel opened it without showing the Text Import Wizard, close the file without saving. Do not make any changes. Then use the File > Open method described above instead.

If you already saved changes to the file, you may have lost data. Close the file and open the original CSV file again using the import method. The original file is still intact — only your saved copy was changed. In the future, always use File > Open rather than double-clicking CSV files.

Saving your CSV file as an Excel workbook

Once your CSV file is open in Excel, you can save it in Excel's native format (.xlsx) if you want to add formulas, charts, or formatting. Go to File > Save As. In the dialog box, change the Save as type dropdown from CSV (Comma delimited) to Excel Workbook (.xlsx). Give the file a new name if you want to keep the original CSV file unchanged. Click Save.

Keep in mind that CSV files do not store formatting, formulas, or multiple sheets. If you save an Excel workbook back to CSV format, all of that information will be lost. If you need both versions, save the workbook as .xlsx and keep a separate copy of the original CSV file.

Common mistakes that damage CSV data

The most common mistake is letting Excel auto-convert columns. If your CSV contains product codes like "00123" or "00456", Excel will strip the leading zeros and turn them into "123" and "456" unless you set those columns to Text format during import. The same happens with long numbers — Excel may switch them to scientific notation (1.23E+10) or round them.

Another mistake is opening a CSV file, making changes, and saving it without checking the file format. Always use Save As and confirm the format before saving. If you are unsure, save as .xlsx first, then decide whether you need a CSV copy later.

A third mistake is assuming that the way the data looks on screen is the way it is stored. Excel may display a number correctly but have changed the underlying value. Always check your data after importing, especially ID codes and numbers with leading zeros.

Frequently Asked Questions

Why does Excel change my numbers when I open a CSV file?

Excel tries to guess what type of data each column contains. If it sees a column of numbers, it converts them to Excel's number format, which removes leading zeros and may round very long numbers. Setting columns to Text format during import prevents this.

Can I open a CSV file without using the import wizard?

Yes, but you risk data loss. If you double-click a CSV file, Excel opens it directly without showing the import options. You can also drag a CSV file into an open Excel window, but this also skips the import dialog. The File > Open method is the safest approach.

What is the difference between CSV and XLSX?

CSV is a plain-text format that stores only data — no formatting, formulas, or multiple sheets. XLSX is Excel's native format and preserves everything. CSV files are smaller and work in almost any program; XLSX files are larger but let you use Excel's full feature set.

Do I need to convert my CSV file to XLSX?

Only if you need to add formulas, charts, or formatting. If your CSV file is just data that you want to view or share, you can leave it as CSV. If you plan to do calculations or create reports, save it as XLSX.

What if my CSV file uses semicolons instead of commas?

During Step 1 of the Text Import Wizard, uncheck the Comma checkbox and check Semicolon instead. The preview at the bottom will update to show how your data will be split. This is common in European CSV files.