· CSV.ink Team

How to Create a CSV File (Without Breaking Excel)

A CSV is plain text: a header line, then one record per line. You can type it, export it, or fill a grid and download it. The mistakes are usually commas, quotes, and encoding.

People ask how to create a CSV file when they do not want a full spreadsheet, or when some upload form rejects .xlsx. The format is older and simpler than Excel: commas separate columns, newlines separate rows, and the first row names the columns.

The smallest valid file

name,city,notes
Emma,Seattle,onsite
Liam,Austin,"remote, US"

Three things are doing the work. The first line is the header. Each later line is one record. Liam’s notes contain a comma, so that field is wrapped in double quotes. A quote inside a quoted field is written twice ("").

Ways to make one

  1. Type it in any text editor and save as .csv with UTF-8 encoding. Fine for a handful of rows.
  2. Fill an online CSV generator: you edit cells, and the tool inserts commas and quotes for you.
  3. Start in Excel or Google Sheets and use Save as CSV. Check the result in a text editor before you send it — Sheets and Excel do not always agree on delimiters.

Create a CSV file online →

What usually goes wrong

  • A comma inside an unquoted field splits one column into two. The rest of the row shifts.
  • Excel on Windows double-clicks a UTF-8 file and shows garbage unless the file starts with a BOM, or you import it as Unicode (UTF-8).
  • Leading zeros (ZIP codes, IDs) disappear if Excel converts the column to a number. Keep those columns as text when you import.
  • A second header row in the middle of the file is just another data row. Do not repeat the header.

CSV or Excel?

Create a CSV when the next step is an import, a script, or a database. Create an Excel file when a person will filter, color, and annotate it. You can always change a CSV file to Excel afterwards if the recipient asks for a workbook.

Change a CSV file to Excel →

Do not put passwords or full customer dumps into a sample file you then email around. CSV is plain text; anyone who opens it can read every cell.

أدوات ذات صلة

← كل المقالات

مزيد من المقالات