What a CSV file is and why you might need one
A CSV file (comma-separated values) is a plain text document where data sits in rows and columns, separated by commas. When you open it in a spreadsheet program like Excel or Google Sheets, it looks like a table. When you open it in a text editor, you see the raw text with commas between each piece of data.
You might create a CSV file to move data between programs — for example, exporting a contact list from one email service and importing it into another, or uploading a customer database to accounting software. CSV files are also the standard format for sharing spreadsheet data because almost every program can read them, regardless of whether you have Microsoft Office, Google Workspace, or something else.
The simplest way to make a CSV file is to start in a spreadsheet program you already have, arrange your data in columns, and save it as CSV instead of the program's native format.
Key Takeaways
- The easiest method is to create your data in Excel or Google Sheets, then save or download the file as CSV format.
- Your first row should contain column headers (like "Name", "Email", "Phone") so the receiving program knows what each column contains.
- CSV files are plain text, so you can also create one by typing data directly into Notepad or a text editor and separating values with commas.
- When you save a spreadsheet as CSV, the program warns you that formatting like colors and formulas will be lost — this is normal and expected.
Creating a CSV file in Excel
Open Excel and enter your data the way you normally would. Put your column headers in the first row — for instance, if you are making a contact list, row 1 might contain "First Name", "Last Name", "Email", and "Phone Number". Then fill in your data below, one row per record.
Once your data is entered, go to File > Save As. In the dialog box, choose the location where you want to save the file. In the "Save as type" dropdown (near the bottom), select CSV (Comma delimited) (*.csv). Give your file a name and click Save. Excel will warn you that the file may contain features not compatible with CSV format — this is normal. Click Yes to proceed. Your file is now saved as a CSV.
Creating a CSV file in Google Sheets
Open Google Sheets and create a new spreadsheet or open an existing one. Enter your column headers in the first row and your data below. Google Sheets handles CSV the same way Excel does — all your data sits in cells, separated by columns.
To download your spreadsheet as a CSV file, click File > Download > Comma Separated Values (.csv). The file downloads to your computer's default download folder with the spreadsheet name as the filename. You can rename it afterward if needed.
Creating a CSV file in a text editor
If you do not have a spreadsheet program or prefer to work in plain text, you can create a CSV file directly in Notepad (Windows) or TextEdit (Mac). Open the text editor and type your data with commas between each value. Your first line should be your column headers, separated by commas.
Here is an example of what the raw text looks like:
First Name,Last Name,Email,Phone Number John,Smith,john.smith@email.com,555-0123 Sarah,Johnson,sarah.j@email.com,555-0456 Michael,Brown,m.brown@email.com,555-0789
When you save the file, name it with a .csv extension at the end — for example, contacts.csv. Make sure you save it as plain text, not as a formatted document. In Notepad this happens automatically. In TextEdit on Mac, go to Format and choose Make Plain Text before saving.
Handling commas and special characters in your data
If any of your data contains a comma — for example, an address like "123 Main St, Apt 4" — the CSV format will break because it uses commas to separate columns. To fix this, wrap that cell's content in quotation marks. In the text editor example above, it would look like this:
First Name,Last Name,Address John,Smith,"123 Main St, Apt 4" Sarah,Johnson,"456 Oak Ave, Suite 200"
If your data contains quotation marks themselves, you need to escape them by doubling them. Most spreadsheet programs handle this automatically when you save as CSV, but if you are typing in a text editor, be aware of this rule. Line breaks within a cell also need the cell wrapped in quotes.
Checking your CSV file before sharing
After you create your CSV file, open it in a text editor to verify the structure is correct. Right-click the file, choose Open with, and select Notepad (Windows) or TextEdit (Mac). You should see your data with commas between values and a new line for each row. If the structure looks wrong — for example, if commas appear in unexpected places — go back to your spreadsheet, fix the data, and save again.
You can also open the CSV file back in your spreadsheet program to see how it displays. This confirms that the receiving program will read it correctly. If columns are misaligned or data appears in the wrong cells, the CSV structure needs adjustment before you share it.
Common reasons a CSV file does not work as expected
The most common issue is that the receiving program expects a specific column order or specific header names. Before you create your CSV, check the documentation or import instructions for the program you are sending it to. It may require headers like "Email Address" instead of "Email", or it may expect columns in a particular sequence.
Another issue is character encoding. Most CSV files use UTF-8 encoding, which handles standard English text and many other languages. If your data contains special characters from another language, some older programs may not read them correctly. Test with a small sample file first if you are unsure.
Blank rows or extra spaces at the beginning or end of cells can also cause import errors. When you create your CSV, avoid leaving empty rows between your data, and trim any accidental spaces from the start or end of cell contents.
Frequently Asked Questions
Can I create a CSV file on my phone or tablet?
Yes, if you have Google Sheets installed on your phone or tablet, you can create a spreadsheet there and download it as CSV the same way you would on a computer. Some spreadsheet apps for mobile devices also support CSV export. However, typing large amounts of data on a phone is slower than on a computer, so most people create CSV files on a desktop or laptop.
What is the difference between CSV and Excel format?
Excel format (.xlsx) preserves formatting like colors, fonts, formulas, and multiple sheets. CSV is plain text and stores only the raw data and cell values. If you save an Excel file with colors and formulas as CSV, those features disappear — only the data remains. Use CSV when you need to share data across different programs; use Excel when you need formatting and advanced features.
Do I need to use a specific program to create a CSV file?
No. You can create a CSV file in any spreadsheet program (Excel, Google Sheets, LibreOffice Calc) or even in a plain text editor like Notepad. The format is the same regardless of which tool you use. Choose whichever program you are most comfortable with.
What happens if I open a CSV file in Excel and make changes?
If you open a CSV file in Excel, make changes, and save it, Excel asks whether you want to keep the CSV format or convert to Excel format. If you choose to keep CSV, only the raw data is saved — any formatting you added is lost. If you want to preserve formatting, save it as an Excel file (.xlsx) instead.
Can a CSV file contain images or links?
CSV files are plain text, so they cannot store images directly. However, you can include a URL link as text in a CSV cell — for example, a column containing website addresses. When you open the CSV in a spreadsheet program, some programs recognize URLs and make them clickable, but the CSV file itself just stores the text.