Updated 2026-10-19 · By Sergi (spnfury)
A CSV (comma-separated values) file is plain text: the first line holds the column names and every following line is one row, with the values separated by commas. Any program that saves text can create one, but each one has its own traps: Excel picks the separator from your regional settings, Notepad may add the wrong extension, and Google Sheets exports only the sheet you are looking at.
This guide shows the five most common ways to create a CSV file, which one to use for each situation, and how to check that the result will import cleanly into a database, an online shop, a CRM or a script.
| Method | Best for | Watch out for |
|---|---|---|
| Online CSV maker | Small files typed or pasted by hand, no software installed | Very large data sets are better generated by a script |
| Excel | Data that already lives in a spreadsheet | Separator follows regional settings; leading zeros and long numbers get changed |
| Google Sheets | Shared data, collaboration, quick exports | Only the current sheet is exported |
| Notepad / TextEdit | Tiny files, quick fixes | Extension and encoding must be set by hand |
| Python | Automation and large or repeated exports | Open files with newline='' to avoid blank lines on Windows |
The quickest way when you have no spreadsheet at hand, or when you want a file that is guaranteed to be comma-separated and UTF-8 regardless of your computer's settings.
Excel writes the separator configured as "list separator" in your operating system. In the US, UK and Canada that is a comma; in most of continental Europe it is a semicolon. If the destination needs commas, either change the regional setting or create the file online instead.
Codes with leading zeros (ZIP codes, phone numbers, product codes) must be stored as text in Excel before saving, or the zeros are lost. Numbers longer than 15 digits, such as card or tracking numbers, are rounded unless they are text too.
Repeat the download for every tab you need: Google Sheets has no option to export all sheets to CSV at once. On a Mac, Apple Numbers works the same way through File > Export To > CSV.
id,name,email,city 1,Ana Lopez,ana@example.com,"Austin, TX" 2,James O'Brien,james@example.com,Seattle
For files generated by a program, use the csv module from the standard library, or pandas if the data is already in a DataFrame. Both handle quoting automatically.
import csv
rows = [
["id", "name", "city"],
[1, "Ana Lopez", "Austin, TX"],
[2, "James O'Brien", "Seattle"],
]
with open("data.csv", "w", newline="", encoding="utf-8") as f:
csv.writer(f).writerows(rows)
# With pandas:
# df.to_csv("data.csv", index=False)
Open the CSV in a viewer that shows the columns as the importer will see them, rather than in Excel, which silently reformats dates and numbers. The CSV viewer and editor on this site shows the detected separator, encoding and column count, and highlights rows that do not fit.
Use an online CSV maker, Google Sheets or a plain text editor. With an online CSV maker you type or paste the data and download a UTF-8, comma-separated file in one click, without installing anything.
Excel uses the list separator of your regional settings, which is a semicolon in most European countries because the comma is the decimal separator there. Change the list separator in your operating system's region settings, or create the CSV with a tool that always uses commas.
Both are comma-separated text files. "CSV UTF-8" saves the text as UTF-8, so accents and non-Latin characters are kept; plain "CSV" uses the legacy Windows encoding of your system, which can turn those characters into question marks in other programs.
No. A CSV file is a single table of plain text. To export a workbook with several sheets, save each sheet as its own CSV file, or keep the data as .xlsx.
The format itself has no limit, but programs do: Excel opens at most 1,048,576 rows per sheet. Larger files can be opened with a large CSV viewer or processed with a database or a script.