CSV files open in spreadsheet programs, text editors, or your web browser

A CSV file (comma-separated values) is a plain-text document that stores data in rows and columns, separated by commas. You can open one in almost any program on your computer — the easiest choice depends on what you plan to do with the data. If you want to edit numbers, sort columns, or create formulas, use a spreadsheet program like Microsoft Excel or Google Sheets. If you just need to read the contents, a text editor or web browser works fine.

The method you choose also depends on what operating system you use and which programs you already have installed. Windows, Mac, and Linux all handle CSV files, though the default program differs on each.

Key Takeaways

  • Double-clicking a CSV file usually opens it in your default spreadsheet program, which is often Microsoft Excel on Windows or Numbers on Mac.
  • Google Sheets can open CSV files directly from your computer without installing anything, and the file stays editable in your browser.
  • If your CSV file opens in a text editor and shows commas between values instead of columns, right-click it and choose to open with a spreadsheet program instead.
  • Large CSV files sometimes open faster in a text editor than a spreadsheet program, though you cannot edit them as easily.

Opening a CSV file by double-clicking it

The fastest way to open a CSV file is to double-click it in your file manager (File Explorer on Windows, Finder on Mac). Your computer will open it in whatever program is set as the default for CSV files. On most Windows computers, this is Microsoft Excel. On Mac, it is usually Numbers or Excel if you have it installed.

When the file opens, the data should appear in columns and rows, with each comma-separated value in its own cell. If instead you see a long line of text with commas between each value, the file opened in a text editor by mistake. Close it and try again using the steps in the next section.

Opening a CSV file with a specific program

If double-clicking does not work the way you want, or if you want to use a different program, right-click the CSV file and look for an "Open with" option. A menu will appear showing programs on your computer that can read CSV files. Choose the one you want to use.

On Windows, you might see choices like Excel, Google Sheets, Notepad, or other spreadsheet programs. On Mac, you might see Numbers, Excel, TextEdit, or others. Click the program name, and the file will open in that program instead. If you want this program to be your default for all CSV files, look for a checkbox that says "Always use this app" or similar, then click it before opening the file.

Opening a CSV file in Google Sheets

Google Sheets is a free spreadsheet program that runs in your web browser and does not require installation. It can open CSV files directly from your computer. Go to sheets.google.com, click the plus sign to start a new spreadsheet, then look for an "Upload" or "Import" tab. Click it and select your CSV file from your computer.

Google Sheets will display the data in columns and rows, and you can edit it immediately. The file stays in your Google Drive, so you can access it from any computer with internet access. If you want to download it back to your computer as a CSV file later, click File, then Download, then choose "Comma-separated values (.csv)".

Opening a CSV file in Microsoft Excel

If you have Microsoft Excel installed, open the program first, then click File and Open. Navigate to your CSV file and click it, then click Open. Excel will display the data in columns and rows. You can edit the numbers, add formulas, or sort the data the same way you would in any other spreadsheet.

When you save the file, Excel will ask whether you want to keep it as a CSV file or convert it to an Excel file (.xlsx). If you choose to save it as CSV, it will stay in comma-separated format. If you choose Excel format, it will gain extra features like multiple sheets and formatting options, but other programs may not read it as easily.

Opening a CSV file in a text editor

If you only need to read the contents of a CSV file and do not plan to edit it, you can open it in a text editor like Notepad (Windows), TextEdit (Mac), or any other plain-text editor. Right-click the file, choose "Open with", and select your text editor. The file will display as plain text with commas between values instead of organized columns.

Text editors are useful for very large CSV files, which sometimes load faster than in a spreadsheet program. They are also useful if you need to see the raw data exactly as it is stored, without any automatic formatting. However, you cannot sort columns, create formulas, or make edits as easily as you can in a spreadsheet program.

Fixing common problems when opening CSV files

If your CSV file opens but the data does not appear in separate columns — for example, if all the data appears in one long column instead of spreading across multiple columns — the file may use a different separator than commas. Some CSV files use semicolons, tabs, or pipes instead. In Excel or Google Sheets, look for an import or text-to-columns option that lets you choose the separator. Select the correct separator, and the data should reorganize into the right columns.

If the file will not open at all, check that the file name ends in .csv. If it ends in something else like .txt or .xls, your computer may not recognize it as a CSV file. You can rename the file by right-clicking it, choosing Rename, and changing the ending to .csv, then try opening it again. If the file is corrupted or incomplete, you may need to download or export it again from wherever you got it.

Frequently Asked Questions

What is the difference between a CSV file and an Excel file?

A CSV file is plain text separated by commas and can be opened by almost any program. An Excel file (.xlsx) is a proprietary format that only Excel and similar spreadsheet programs can fully read. Excel files can store multiple sheets, formulas, and formatting. CSV files are simpler and more universal, but cannot store as much information.

Can I edit a CSV file and save the changes?

Yes, if you open it in a spreadsheet program like Excel or Google Sheets. Make your changes, then save the file. If you opened it in a text editor, you can edit the text directly, but it is harder to work with the data in columns. Avoid opening CSV files in text editors if you plan to edit them.

Why does my CSV file open in Notepad instead of Excel?

Your computer is set to open CSV files with Notepad by default. Right-click the CSV file, choose "Open with", select Excel or another spreadsheet program, and check the box to make it your default. After that, double-clicking CSV files will open them in that program.

Can I open a CSV file on my phone?

Yes, but it depends on your phone. On iPhone, you can use the Numbers app or Google Sheets. On Android, Google Sheets, Microsoft Excel, or other spreadsheet apps can open CSV files. Download the app, then open the CSV file from your phone's file manager or email attachment, and choose the spreadsheet app to open it with.

What if my CSV file is very large and opens slowly?

Large CSV files sometimes open faster in a text editor than in a spreadsheet program. If you only need to view the data, try opening it in Notepad or TextEdit. If you need to edit it, try opening it in Excel or Google Sheets but avoid adding formulas or sorting until the file is fully loaded. You can also split the CSV file into smaller pieces using a text editor or command-line tool.