What a CSV file is and why you might create 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 normal table. When you open it in Notepad, you see text with commas between the values. CSV files are useful because almost every program that works with data — accounting software, email systems, databases, contact managers — can read them.
You might create a CSV file to move data from one program to another, to back up a list of contacts, or to prepare data for import into a system that requires this format. Unlike Excel files (.xlsx), which can contain formulas and formatting, a CSV file stores only the raw data itself, which is why it works across so many different platforms.
Key Takeaways
- The simplest way to create a CSV file is to type or paste your data into a spreadsheet, then save it as CSV format instead of the default Excel or Sheets format.
- A CSV file contains only data separated by commas — no formulas, colors, or special formatting survive the conversion.
- You can also create a CSV file by typing directly into Notepad or any text editor, placing commas between values and pressing Enter at the end of each row.
- When you save a spreadsheet as CSV, the program warns you that formatting will be lost — this is normal and expected.
Creating a CSV file from Excel
Open Excel and enter your data into the spreadsheet. Put each column header in the first row — for example, "First Name", "Last Name", "Email". Then fill in your data rows below. You do not need formulas or special formatting; just type or paste the values you want to include.
Once your data is entered, click File in the top left, then select Save As. In the dialog that opens, choose the location where you want to save the file. In the Save as type dropdown (near the bottom of the dialog), select CSV (Comma delimited) (*.csv). Type a name for your file in the filename box — for example, "contacts" — and click Save. Excel will show a warning that says the file may contain features not compatible with CSV format. Click Yes to confirm. Your file is now saved as a CSV.
If you have multiple sheets in your workbook, Excel saves only the sheet you are currently viewing as CSV. If you need all sheets as separate CSV files, save each one individually by clicking on its tab first, then repeating the Save As process.
Creating a CSV file from Google Sheets
Open Google Sheets and create a new sheet or open an existing one. Enter your data the same way you would in Excel — headers in the first row, data below. Google Sheets does not require you to format anything specially.
Click File at the top left, then hover over Download. A submenu appears with several format options. Click Comma Separated Values (.csv). The file downloads to your computer's default download folder with the sheet name as the filename. If you want to rename it, find the file in your downloads folder and rename it there. Like Excel, Google Sheets saves only the current sheet as CSV — if you have multiple sheets, download each one separately.
Creating a CSV file in a text editor
Open Notepad (on Windows) or TextEdit (on Mac), or any plain text editor. Type your data with commas separating each value and pressing Enter at the end of each row. For example:
First Name,Last Name,Email John,Smith,john@example.com Jane,Doe,jane@example.com
Make sure there are no extra spaces around the commas unless those spaces are part of your actual data. If a value contains a comma (for example, a company name like "Smith, Jones & Associates"), wrap that value in quotation marks: "Smith, Jones & Associates",contact@example.com. This tells the program that the comma inside the quotes is part of the data, not a separator.
Once you have typed all your data, click File, then Save As. Choose where to save the file, type a filename with the .csv extension (for example, "contacts.csv"), and click Save. On Mac, TextEdit may ask whether you want to save as plain text — select Use Plain Text. Your CSV file is now ready to use.
What happens to formatting when you save as CSV
When you convert a spreadsheet to CSV format, the program strips away everything except the raw data. This means colors, bold text, cell borders, formulas, and merged cells all disappear. If a cell contains a formula (like =SUM(A1:A10)), the CSV file stores only the result of that formula, not the formula itself.
This is not a problem — it is how CSV files are designed to work. They prioritize compatibility over appearance. If you need to keep your formatting, save the file in Excel format (.xlsx) or Google Sheets format instead. But if you are moving data to another program, CSV is usually the right choice because the other program does not need or want the formatting anyway.
Checking and fixing your CSV file
After you create a CSV file, open it in a text editor to verify it looks correct. Right-click the file, select Open with, and choose Notepad (Windows) or TextEdit (Mac). You should see your data with commas between values and each row on a new line. If commas are in the wrong places or data is missing, go back to your spreadsheet, fix the data, and save as CSV again.
You can also open the CSV file in Excel or Google Sheets to see it in table format and confirm the columns and rows are correct. This is often easier than reading the raw text version. If the data looks wrong when opened in a spreadsheet — for example, if all your data ended up in one column instead of spreading across multiple columns — the file may have been saved with the wrong delimiter. Go back and save it again, making sure you selected the CSV (comma delimited) option, not a semicolon or tab-delimited format.
Common issues when creating CSV files
If your data contains line breaks within a cell (text that wraps to multiple lines), the CSV file may not handle it correctly when imported elsewhere. To avoid this, remove line breaks before saving. In Excel, you can use Find & Replace to remove them: press Ctrl+H, check the "Regular expressions" box, search for \n, and replace with nothing.
If you have special characters like accents or symbols, they usually transfer fine to CSV, but some older programs may not read them correctly. Test the file in the program where you plan to use it before relying on it. If special characters cause problems, you may need to use a different file format or contact the program's support team for guidance on how they handle non-standard characters.
Frequently Asked Questions
Can I edit a CSV file after I create it?
Yes. You can open a CSV file in Excel, Google Sheets, or a text editor, make changes, and save it again. If you open it in a spreadsheet program and save it as CSV, you will get the same warning about losing formatting — this is normal. If you edit it in a text editor, just make sure you keep the commas in the right places and save it with the .csv extension.
What is the difference between CSV and Excel format?
CSV files contain only data and commas; Excel files (.xlsx) can store formulas, colors, multiple sheets, and other formatting. CSV is simpler and works with more programs, but Excel is better if you need to keep formulas or complex formatting. Most programs that need data can read CSV, but not all can read Excel.
Do I need to add quotation marks around all my data?
No. Quotation marks are only necessary around values that contain commas, quotation marks, or line breaks. For simple text and numbers, you do not need them. If you add quotation marks around everything, the CSV file will still work, but it is not necessary.
Why does my CSV file open in the wrong program?
Windows and Mac associate file types with default programs. If your CSV opens in Notepad instead of Excel, right-click the file, select Open with, choose Excel or Google Sheets, and check the box that says "Always use this program for this file type." Next time you double-click it, it will open in your chosen program.
Can I create a CSV file on my phone or tablet?
Google Sheets works on phones and tablets and can save files as CSV. Open the sheet, tap the three-dot menu, select Download, and choose CSV format. On iPhone, the file goes to your Files app; on Android, it goes to your Downloads folder. Desktop programs like Excel are not available on most phones, so Google Sheets is usually your best option.