- A CSV (comma-separated values) file is a simple text file in which information is separated by commas.
- CSV files are most commonly encountered in spreadsheets and databases.
- You can use a CSV file to move data between programs that aren't ordinarily able to exchange data.
- Visit Insider's Tech Reference library for more stories.
If you spend any time with spreadsheet applications like Microsoft Excel or Google Sheets – or even import certain kinds of data into Microsoft Outlook – you will inevitably encounter a comma-separated values file, commonly known as a CSV.
A CSV file is a simple text file that you can open in a wide variety of programs, including any program that works with plain text like the Notepad app; what makes a CSV file unique is the way its content is organized.
What to know about a CSV file
A CSV file, as the name implies, typically separates information using commas. It's a way to exchange structured information, like the contents of a spreadsheet, among programs that can't necessarily talk to one another directly.
As long as two programs can both open a CSV file, they can exchange data. For example, you can save contact information from Microsoft Excel as a CSV file, and import it into the address book in Microsoft Outlook.
A typical CSV file looks like this, where each line contains the same sequence of data so any program which needs to read it knows what to expect:
Product, Size, Color, Price
Shirt, Medium, Blue, $14
Shirt, Large, Red, $15
Pants, Medium, Khaki, $23
Despite the name, a CSV doesn't need to rely on commas as the separator between pieces of information. This separator, called a delimiter, can be a semicolon, space, or some other character, though the comma is most common.
How to open a CSV file in Google Sheets
Opening a CSV file in Google Sheets is much simpler because Sheets automatically sets all the options during import.
- In Google Sheets, click "File" and then click "Open."
- Find the CSV file and select it. If needed, click "Upload" and then drag and drop it from your computer.
- The CSV will automatically be formatted properly and appear in Sheets.
How to open a CSV in a text editor
Unlike spreadsheets, a text editor won't automatically format or structure the CSV file for you. Instead, you'll simply see the data separated by the comma or other delimiter. It's usually not aesthetically appealing, but it's an easy way to see the content of the file.
- Open a text editor like Windows Notepad or TextEdit.
- Click "File" and then "Open."
- In the "File Open" dialog box, click the drop-down menu to the right of the "File name" field. If it's currently set to "Text Documents," change it to "All Files."
- Find the CSV file and select it.
And of course, once you've imported your CSV file into any of these programs, you can then edit the data like you would with any other file.