Skip to content
SoftwareSolutions.net
Cheat sheet

CSV Format Rules Cheat Sheet

The rules that make a CSV file read correctly in spreadsheets and databases, including quoting, delimiters and encoding.

CSV stores a table as plain text. Each line is a row, and each value is separated by a comma. Some countries use a semicolon instead, so check which one your software expects.

Structure

  • First line is usually the column headers
  • Each row has the same number of values
  • Use a comma, or a semicolon where your region expects it
  • Use UTF-8 encoding for non-English text

Quoting

  • Wrap a value in double quotes if it contains a comma
  • Double a double quote inside a quoted value: "" means one quote
  • Line breaks inside a quoted value are allowed

Common problems

  • Leading zeros disappear when opened in a spreadsheet
  • Dates may change format on import
  • Extra commas in values split them into two columns