How to Import a CSV File into Excel

To import a CSV file into Excel, open a workbook, go to Data > From Text/CSV, pick the file, and select Import. Excel shows a preview where you can check the delimiter before you select Load. This route gives you more control than double-clicking the file, which opens it with Excel’s default settings.

Applies to: Excel for Microsoft 365, Excel 2024, Excel 2021, Excel 2019 and Excel 2016 on Windows, with a short section for Excel for Mac.

What a CSV file is, and why importing beats opening

CSV stands for comma-separated values. It is a plain text file in which each line is a row and a separator character, called a delimiter, marks where one column ends and the next begins. The delimiter is usually a comma, but some files use a semicolon, a tab or another character. A CSV holds values only. It has no formatting, no formulas and no extra sheets.

Excel can bring a CSV in two ways, and the difference matters:

Route What happens Best for
Open the file (File > Open or a double-click) Excel opens the data in a new workbook and applies its default data format settings. You do not get a preview. Simple files with ordinary text and numbers that you only need to look at.
Import the file (Data > From Text/CSV) Excel shows a preview, lets you choose the delimiter and the file’s character set, and keeps a connection to the file so the data can be refreshed. Files with ID numbers, leading zeros, long numbers, dates, an unusual delimiter, or data that changes regularly.

If you are not sure which one you need, import the file. It takes a few more clicks, and you see the result before anything is placed in your sheet.

Before you start

  • Know where the CSV file is saved, for example your Downloads folder.
  • Keep an untouched copy of the original file if it is your only copy. Importing does not change the CSV, but saving over it from Excel later can.
  • Check the size if the file is very large. Excel can import or export up to 1,048,576 rows and 16,384 columns. Bigger files can still be summarized with a PivotTable, as explained under “This data set is too large” in troubleshooting.

Import a CSV file with Data > From Text/CSV

  1. Open Excel with a blank workbook, or open the workbook that should receive the data, and click the cell where the data should begin.
  2. Select the Data tab on the ribbon.
  3. In the Get & Transform Data group, select From Text/CSV. The Import Data dialog opens.
  4. Browse to the CSV file, select it, and select Import. A preview window opens that shows the first rows of the file split into columns.
  5. Look at the preview. If every value sits in its own column, the delimiter is right. If everything is squeezed into one column, choose a different character from the list under Delimiter. The preview updates as soon as you change it.
  6. If accented letters or symbols look garbled, pick a different character set in the File Origin list.
  7. Select Load to place the data in the workbook. To choose the exact location, select the arrow beside Load, select Load To, choose where the data should go, and select OK.
Illustration of the path to import a CSV file in Excel: Data tab, From Text/CSV, Import, check Delimiter, then Load
Illustration: the path from the Data tab to From Text/CSV, Import, the Delimiter check and Load.

When the import finishes, the rows and columns from the CSV appear in the worksheet. The same route is described on Microsoft Support in Import or export text (.txt or .csv) files.

The three settings in the preview window

The preview has three lists across the top. Most files load correctly without touching them, but it helps to know what each one does.

  • File Origin sets the character set (encoding) used to read the file. UTF-8 is only detected automatically when the file starts with a UTF-8 byte order mark, so files from other systems sometimes need this changed by hand.
  • Delimiter sets the character that separates columns. The list includes colon, comma, equals sign, semicolon, space and tab, plus a custom option and a fixed width option.
  • Data Type Detection controls how Excel guesses whether a column is text, a number or a date. The choices are Based on first 200 rows, Based on entire dataset and Do not detect data types. The last one brings every column in as text, which is the safest choice when the file is full of codes and ID numbers. Checking the entire dataset is more thorough, but it can make the first load slower.

Keep leading zeros, long numbers and codes intact

By default Excel treats anything that looks like a number as a number. That removes the zeros from a ZIP code such as 02134. Excel also has a maximum precision of 15 significant digits, so a 16-digit number such as a card number is rounded. To prevent this, set those columns to text during the import instead of fixing them afterward.

  1. Follow steps 1 to 4 above so the preview window is open.
  2. Select Transform Data instead of Load. The Power Query Editor opens with your data.
  3. Click the header of the column you want to protect.
  4. Go to Home > Transform > Data Type and select Text.
  5. If a Change Column Type message appears, choose Replace Current.
  6. Repeat for any other columns, then select Close & Load. The data returns to the worksheet with those columns stored as text.

Microsoft Support has more on keeping leading zeros and large numbers. Zeros already gone in a sheet you typed or pasted need the cell-format fixes in stopping Excel from removing leading zeros, and product codes that keep turning into dates are covered in getting Excel to stop changing entries into dates.

Turn off automatic conversions (Microsoft 365 and Excel 2024)

Excel for Microsoft 365 and Excel 2024 also have settings that stop these conversions at the source. Go to File > Options > Data and find the Automatic Data Conversion section. Clear the box for any conversion you do not want:

  • Remove leading zeros and convert to a number
  • Keep first 15 digits of long numbers and display in scientific notation
  • Convert digits surrounding the letter “E” into a number in scientific notation
  • Convert continuous letters and numbers to a date

The same section has an option named When loading a .csv file or similar file, notify me of any automatic data conversions. Leave it selected and Excel tells you when it is about to change values in a CSV that you open directly. Every setting is explained in Data import and analysis options in Excel. Earlier versions do not have this section, so use the Text data type method above.

Open a CSV file directly with File > Open

When the file is simple and you only need to read it, opening it is quicker.

  1. In Excel, go to File > Open and browse to the folder that holds the file.
  2. In the file type list in the Open dialog, select Text Files.
  3. Double-click the CSV file. Excel opens it in a new workbook.

When Excel opens a .csv file this way, it uses the current default data format settings to decide how each column is brought in. Use the import route when you need more control, such as with dates in a different order or numbers with leading zeros. The file you opened is also still a CSV. Any formatting you add is lost unless you save a copy as an Excel workbook, which is covered below.

Use the legacy Text Import Wizard

Older versions of Excel imported text files with a three-step Text Import Wizard. It still exists in Excel for Microsoft 365, Excel 2024 and Excel 2021, but it is a legacy feature that you have to switch on first. Some people prefer it because it lets you set a format for each column one by one.

  1. Go to File > Options > Data.
  2. Under Show legacy data import wizards, select From Text (Legacy) and confirm.
  3. Go to the Data tab and select Get Data > Legacy Wizards > From Text (Legacy).
  4. In the Import Text File dialog, double-click the CSV file. The wizard starts.
  5. In step 1, choose Delimited as the original data type. Use Start import at row if the file has title lines above the data that you want to skip, and File origin if the characters look wrong.
  6. In step 2, select the delimiter that your file uses. Tick Treat consecutive delimiters as one only if repeated separators should not create empty cells. Text qualifier is the character that wraps values containing the delimiter, normally a quotation mark.
  7. In step 3, click each column in the preview and set its Column data format: General, Text or Date, or Do not import column (skip) to leave it out. Choose Text for ZIP codes, account numbers and other codes. Then finish the wizard and choose where to put the data.

Each option is described in the Text Import Wizard reference.

Import a CSV file in Excel for Mac

In Excel for Microsoft 365 for Mac, Excel 2024 for Mac and Excel 2021 for Mac, the steps follow the same idea with a slightly longer menu path.

  1. On the Data tab, in Get & Transform Data, select Get Data > From File.
  2. Select From Text/CSV.
  3. Select the CSV file, then select Import.
  4. Review the data, select the arrow beside Load, and select Load To.
  5. Choose Existing worksheet or New worksheet, then select OK. With New worksheet, Excel adds a sheet and places the data at its upper-left corner.

The Mac steps match Import data from a CSV, HTML, or text file on Microsoft Support.

Confirm the import worked

A CSV can load without any error message and still be wrong. Spend a minute on these checks before you rely on the data:

  • Columns: every heading sits above the right kind of value, and no row is shifted one column to the right.
  • Row count: scroll to the last row and compare it with the number of records you expected from the source system.
  • Codes and IDs: find a value that should start with zero and confirm the zero is still there. Look at one long number and confirm it is not shown in a form like 1.23E+15.
  • Dates: check a date where the day is 12 or lower, such as 03/04/2026, against the source so you know month and day were not swapped.
  • Characters: look at names with accents or symbols. Odd replacement characters mean the wrong File Origin was used.

If something is off, it is usually faster to remove the imported data and import again with different settings than to repair it cell by cell.

Refresh the data or save it as a workbook

Data brought in with From Text/CSV stays connected to the original file. When the CSV is replaced with a newer export of the same name in the same folder, you do not have to import again. Select Data > Refresh All, or press Ctrl + Alt + F5 to refresh everything in the workbook. Alt + F5 refreshes only the data you have selected.

To refresh automatically, go to Data > Queries & Connections, right-click the query, select Properties, and on the Usage tab select Refresh data when opening the file or Refresh every with a number of minutes. More refresh options are in Refresh an external data connection in Excel.

To keep formatting, formulas and more than one sheet, save the result as an Excel workbook. Go to File > Save As, pick a location, and in the Save as type box choose the Excel workbook (.xlsx) format. If you need to hand the data back as a CSV, choose CSV (Comma delimited) in the same box. Saving in a text format removes all formatting and saves only the active sheet, so keep the .xlsx copy as well.

Troubleshooting CSV imports

All the data lands in one column

The delimiter does not match the file. In the import preview, change the Delimiter list to the character your file actually uses. Semicolons are common in files exported with European regional settings. If the file was already opened directly and the data is sitting in column A, you can either close it and import it properly, or split the column in place with Text to Columns in Excel.

Leading zeros are missing or long numbers show as 1.23E+15

Excel converted the values to numbers. The original characters cannot be recovered from the worksheet, because the zeros and the digits past the fifteenth are not stored. Import the CSV again and set the column to Text with Transform Data, or select Do not detect data types in the preview.

Codes turned into dates

Values such as JAN1 or 1-2 look like dates to Excel. Re-import with the column set to Text. In Excel for Microsoft 365 and Excel 2024 you can also clear Convert continuous letters and numbers to a date under File > Options > Data.

Accented letters or symbols look wrong

The file was read with the wrong character set. Import it again and try another entry in the File Origin list until the preview shows the text correctly.

“This data set is too large for the Excel grid”

This message appears when a file has more rows or columns than a worksheet can hold. The full text warns that if you save the workbook, you lose the data that was not loaded, so do not save over the original. Instead, open a blank workbook, go to Data > From Text/CSV, select the file and Import, then choose Load To and PivotTable Report. That lets you summarize the whole file without placing every row on a sheet. If you must save what did load, use File > Save a Copy with a name that shows it is incomplete. The details are in What to do if a data set is too large for the Excel grid.

From Text (Legacy) is not in the Get Data menu

The legacy wizards are hidden until you enable them. Go to File > Options > Data and select From Text (Legacy) under Show legacy data import wizards. After that it appears under Data > Get Data > Legacy Wizards.

Options or import commands are unavailable on a work or school computer

Organizations can restrict Excel settings and where files may be opened from. If a command described here is missing or disabled on a managed device, and you have confirmed your Excel version is one of those listed at the top, ask your IT administrator rather than looking for a workaround.

Frequently asked questions

Does importing change the original CSV file?

No. Importing reads the file and places a copy of the data in your workbook. The CSV only changes if you open it directly and save over it.

What is the difference between opening and importing a CSV?

Opening loads the file straight into a new workbook with Excel’s default conversions. Importing with From Text/CSV shows a preview first, lets you set the delimiter, character set and data types, and keeps a connection so the data can be refreshed later.

How many rows can Excel import from a CSV?

A worksheet holds up to 1,048,576 rows and 16,384 columns. A larger file can still be analyzed by loading it to a PivotTable report, as described in the troubleshooting section.

Can I import several CSV files at once?

Yes, when the files share the same layout and sit in one folder. Use Data > Get Data > From File > From Folder to combine them into a single table.

Why does my CSV use semicolons instead of commas?

The program that created it used a different separator, which often happens in regions where the comma is the decimal mark. Excel handles this in the import preview: set Delimiter to semicolon and the columns line up.

Will my formulas and formatting be saved if I keep the file as a CSV?

No. A CSV stores plain values from the active sheet only. Save a copy as an Excel workbook to keep formatting, formulas, charts and extra sheets.

Once the data is in place and checked, save the workbook as an .xlsx file so your work is kept, and use Refresh All the next time the CSV is updated.

Data in another form? You can also open a JSON file in Excel or copy and paste data in cleanly.