How to Create a CSV File

Last updated 19 August 2026 · about 6 minutes to read

Make a CSV in Excel, Google Sheets, a text editor or a browser. The delimiter, the encoding and the quoting rules that decide whether it opens correctly for whoever gets it.

A CSV is a text file where each line is a row and a delimiter separates the fields. That is the whole specification. Making one is easy; making one that opens correctly on somebody else's machine is where the work is, and it comes down to three settings.

In Excel

  • File, then Save As.
  • Choose CSV UTF-8 (Comma delimited) rather than plain CSV. This is the single most important choice on the list and it is explained below.
  • Excel warns that only the active sheet will be saved. That is correct: a CSV holds one table, so a workbook with twelve tabs saves as one of them.

Before you save, format any column holding an identifier as Text. Account numbers, product codes and postcodes are the ones that matter, because a column Excel is treating as numeric has already lost its leading zeros before you get anywhere near the save dialog.

In Google Sheets

  • File, then Download, then Comma Separated Values.
  • Only the current sheet is exported, the same as Excel.
  • Sheets always writes UTF-8, so the encoding problem below does not arise. It does not write a byte order mark, which means the file may still open wrongly in Excel on Windows.

In a text editor

A CSV is text, so any editor makes one. Save it with a .csv extension and follow the quoting rules: wrap a field in double quotes if it contains the delimiter, a double quote or a line break, and double any quote inside a quoted field.

The three cases that need quoting
name,role,note
Halima Yusuf,"Analyst, data",joined in March
"Pryce, Jonah",Engineer,"said ""about a week"""
Wei Chen,Manager,"two
lines in one field"

Save as UTF-8. Most editors default to it now; Windows Notepad offers UTF-8 and UTF-8 with BOM as separate options, and which one you want depends on the reader.

In the browser

Type the table into the CSV generator on this site and download it. The quoting is applied on the way out, so you enter the value you mean rather than the value plus its escaping, and the delimiter and byte order mark are both controls rather than something you get wrong once and discover later.

The three settings that actually matter

The delimiter

It is not recorded in the file. Excel splits a CSV using the list separator from the operating system's regional settings, and across most of Europe that is a semicolon, because the comma is the decimal separator there. A comma-separated file therefore opens as one column on a machine set up that way.

If you know the recipient's locale, match it. If you do not, send a comma-separated file and tell them, or use tabs instead, which almost never appear inside a value.

The encoding

Also not recorded in the file, and this is the cause of nearly every question about strange characters. Excel on Windows assumes a CSV is in the local code page unless the file begins with a UTF-8 byte order mark, which is three bytes that mean nothing except this is UTF-8.

Save As CSV UTF-8 in Excel writes that mark. Most other tools do not. If your data is pure ASCII, none of this matters; the moment there is an accent, a currency symbol or a non-Latin script in it, it matters completely.

The quoting

Get this wrong and the file looks fine and imports wrong, which is the worst combination. A value containing an unquoted comma splits into two fields, and the row is then one field too wide. A value containing an unquoted double quote breaks the parser at a point that has nothing to do with where the mistake is.

Things that are not CSV

  • Renaming a .xlsx to .csv. The contents are still a zip archive of XML. Excel will open it, complain that the extension does not match the format, and show you one column of noise.
  • A spreadsheet with merged cells. Merges flatten on export and the rows below often end up misaligned. Unmerge before you save.
  • A file with a title row above the headers. Every reader treats the first line as the header, so a title there means your real headers become the first row of data.

Checking it before you send it

Open the file in a text editor rather than in a spreadsheet. What is on those lines is what is in the file. Anything different on screen in Excel is Excel's interpretation, not the data, and interpretation is exactly what you are trying to check.

Tools mentioned here

Questions

What is the difference between CSV and CSV UTF-8 in Excel?

CSV UTF-8 writes the file as UTF-8 with a byte order mark at the start. Plain CSV writes it in the machine's local code page. Choose CSV UTF-8 unless you know the recipient needs something else; it is the option that survives accented and non-Latin characters.

How do I make a CSV without Excel?

Any text editor works, since a CSV is text. Google Sheets exports one, and so does the generator on this site, which applies the quoting rules for you and lets you set the delimiter and the byte order mark.

Can a CSV have more than one sheet?

No. A CSV is one table. If you need several, send several files or send a spreadsheet.

How do I stop Excel changing my values?

Format the affected columns as Text before entering the data, and when opening a CSV use Data then From Text so you can mark columns as Text in the import wizard. Double-clicking a CSV skips that wizard entirely, which is why it is the one thing not to do.

More guides