What Is a CSV File?

Excel and Google Sheets are your best options for opening and editing CSV files

What to Know

  • A CSV file is a comma-separated values file; view/edit one with Excel, WPS Office Spreadsheet, or Google Sheets.
  • Convert CSV to Excel (XLSX), PDF, XML, TXT, etc., with those same programs or Zamzar.
  • CSV files can also be imported into most email clients and other programs that deal with structured data.

This article explains what a CSV file is and the best methods I've used to open, edit, and convert one.

What Is a CSV File?

A CSV file is a comma-separated values file. It's a plain text file that can contain numbers and letters only, and structures the data contained within it in a tabular, or table, form.

Excel CSV files

Files ending in the CSV file extension are generally used to exchange data, usually when there's a large amount, between different applications. Database programs, analytical software, and other applications that store massive amounts of information (like contacts and customer data), usually support this format.

A comma-separated values file might sometimes be referred to as a character-separated values or comma-delimited file, but regardless of how someone says it, they're talking about the same format.

CSV is also short for computer software validation, comma-separated variable, circuit switched voice, and colon-separated value.

How to Open a CSV File

I like to use spreadsheet software to open and edit CSV files. My favorites are the popular ones, so that includes Microsoft Excel and free options like OpenOffice Calc and the Spreadsheet program from WPS Office. Spreadsheet tools are great for CSV files because the data contained in the file is usually going to be filtered or manipulated in some way, which spreadsheet programs are built for.

Lifewire / Marina Li 

Another method for viewing or editing a CSV file is to do so online. I use Google Sheets for that because it looks and feels like a desktop app and includes lots of really great features. To go that route, visit that link and select the folder icon to browse your computer or Google Drive account for the file.

You can also use a text editor, but large ones will be very difficult to work with in these types of programs. If you want to do this, see our favorites in this Best Free Text Editors list.

Like I mentioned above, Excel supports CSV files, too, but the program isn't free to use. Even so, it's probably the most commonly used program for viewing and editing CSV files.

Considering the number of programs out there that support structured, text-based data like CSV, you may have more than one program installed that can open these types of files. If so, and the one that opens by default when you double-tap or double-click on CSV files in Windows isn't the one you like to use with them, changing that program in Windows is very easy.

Another way to "open" a CSV file is to import it. You'd do this if you want to use the data from the file in an application that isn't really meant for editing, but for viewing/using the content.

Contact information is the most obvious example; you can import contacts into your Google account, for instance, to sync the contact details from the CSV file with Gmail. In fact, lots of email clients support exporting and importing contact information via the CSV format, including Outlook, Yahoo, and Windows Mail.

How to Convert a CSV File

Since CSV files store information in a text-only form, support for saving the file to another format is included in lots of online services and desktop programs.

All the computer software mentioned above can convert a CSV file to Excel formats like XLSX and XLS, as well as to TXT, XML, SQL, HTML, ODS, and others. This conversion process is usually done through the File > Save as menu.

You can also use Google Sheets. From the File > Download menu, pick XLSX, ODS, PDF, or any other supported format.

There are also some free document file converters that run in a web browser, my favorite being Zamzar, which can convert CSV files to some of the formats listed above as well as to PDF and RTF.

Csvjson (guess...) converts CSV data to JSON, super helpful if you're importing massive amounts of information from a traditional application into a web-based project.

You can't usually change a file extension (like CSV) to one that your computer recognizes and expect the newly renamed file to be usable. An actual file format conversion using one of the methods described above must take place in most cases. However, since these files can only contain text, you could rename any CSV file to any other text format, and it should open, albeit in a less helpful way than if you had just left it at CSV.

Still Can't Open It?

CSV files are deceptively simple. As straightforward as they are at first look, the slightest misplacement of a comma, or a basic confusion like the one discussed below, can make them feel like rocket science.

Keep in mind that you might not be able to open the file or read the text within it, for the simple reason that you're confusing another file for one in the CSV format. Some files share some of the same file extension letters but aren't actually in the same format, or even a remotely similar one.

CVS, CVX, and CV are just a few examples where the files probably can't open in a spreadsheet program even though the suffix looks a lot like CSV. If this is the case with your file, research the real file extension on Google or here on Lifewire, to see its compatible openers or converters.

Important Information on Editing CSV Files

You'll probably only encounter a CSV file when exporting information from one program to a file, and then use that same file to import the data into a different program, especially when dealing with table-oriented applications.

However, you may at times find yourself editing a CSV file, or making one from scratch, in which case the following should be kept in mind:

A common program used to open and edit CSV files is Excel. Something important to understand about using Excel, or any other similar spreadsheet software, is that even though those programs appear to provide support for multiple sheets when you're editing a CSV file, the CSV format does not support "sheets" or "tabs," so data you create in these additional areas won't be written back to the CSV when you save.

For example, let's say you modify data in the first sheet of a document and then save the file to CSV—that data in the first sheet is what will be saved. However, if you switch over to a different sheet and add data there, and then save the file again, it's the information in that recently-edited sheet that will be saved. The data in the first sheet will no longer be accessible after you've shut down the spreadsheet program.

It's really the nature of the spreadsheet software that makes this mishap confusing. Most spreadsheet tools support things like charts, formulas, row styling, images, and other things that simply can't be saved under the CSV format.

There's no problem, so long as you understand this limitation. This is why other, more advanced table formats exist, like XLSX. In other words, if you want to save any work beyond very basic data changes to a CSV, don't use CSV anymore—save or export to a more advanced format instead.

How CSV Files Are Structured

It's easy to make your own CSV file. Just get your data sorted how you want in one of the tools mentioned above, and then save what you have to the CSV format.

You can also create one manually, yes—from scratch, using any text editor.

Here's one example:

Name,Address,Number
John Doe,10th Street,555

All CSV files follow the same overall format: each column is separated by a delimiter (like a comma), and each new line indicates a new row. Some programs that export data to a CSV file may use a different character to separate the values, like a tab, semicolon, or space.

What you see in the example above is how the data would appear if the CSV file were opened in a text editor. However, since spreadsheet software programs can open CSV files, and those programs contain cells to display information, the Name value would be positioned in the first cell with the John Doe in a new row just below it, and the others following the same pattern.

If you're embedding commas or using quotation marks in your CSV file, read edoceo's and CSVReader.com's articles for how you should go about that.

Frequently Asked Questions

  • How do I export my iPhone contacts to a CSV file? Export contacts from an iPhone using a third-party app such as Export to CSV. In the Export to CSV app, select Begin Exporting > + > Edit Column Data > choose a source > Export.
  • How do you read a CSV file in MATLAB? To read a CSV file in MATLAB, drag and drop the CSV file in any folder on the MATLAB path. Then, in the MATLAB Command Window, type m = csvread(‘name_of_file.dat’); substituting the name of the CSV file for name_of_file.dat.
Was this page helpful?