⌘K

Data Formats

CSV

CSV (Comma-Separated Values) is a plain-text table format where each line is a row and each field is separated by a delimiter, usually a comma.

Updated 12 Aug 2026

The simplest useful data format

A CSV file is a table written as text. The first line usually holds column headers, every following line holds one record, and fields are separated by a delimiter. There is no type system: 42, 2026-01-01 and true are all just strings until something interprets them.

That simplicity is why every spreadsheet, database and analytics tool can import CSV, and also why CSV files break so often. RFC 4180 describes the common conventions, but plenty of exporters ignore it.

Quoting rules that matter

  • A field containing the delimiter, a quote or a line break must be wrapped in double quotes
  • A double quote inside a quoted field is escaped by doubling it: ""
  • Every row should have the same number of fields as the header
  • Encoding should be UTF-8; a byte-order mark can confuse older parsers

Why exports go wrong

Regional delimiters

Locales that use a comma as a decimal separator often export semicolon-delimited files.

Unquoted commas

An address field written without quotes silently shifts every later column.

Lost leading zeros

Spreadsheets convert 00123 to 123 unless the column is imported as text.

Mixed line endings

Files edited on both Windows and Unix can end up with inconsistent row breaks.

CSV to JSON

Turn a spreadsheet export into clean, typed JSON in one step.

Try CSV to JSON

Characteristics

  • Plain text, one record per line
  • Delimiter is usually a comma, sometimes a semicolon or tab
  • No data types — every field is text
  • Flat structure only; nesting must be flattened into columns

Common uses

  • Spreadsheet and database exports
  • Bulk import into CRMs, ad platforms and analytics tools
  • Data science workflows and quick ad-hoc analysis
  • Simple interchange between systems that share no API

Advantages

  • Universally supported by spreadsheets, databases and scripts
  • Streams row by row, so files larger than memory are fine
  • Compact for uniform tabular data
  • Readable and diffable as plain text

Limitations

  • No standard for types, dates or encoding
  • Cannot represent nested or hierarchical data
  • Delimiter and quoting inconsistencies break imports
  • No schema, so column meaning depends on convention

Examples

Quoting protects a field that contains a comma
id,name,city,notes
4821,Ada Lovelace,London,"Prefers email, not phone"
4822,Alan Turing,Wilmslow,

Frequently asked questions

What is a CSV file used for?

Moving tabular data between spreadsheets, databases and applications that do not share a direct integration.

Is CSV the same as Excel?

No. CSV is plain text with no formulas, formatting or multiple sheets; XLSX is a compressed, structured workbook format.

Which delimiter should I use?

Comma for international interchange. Use semicolons or tabs only when the destination expects them.

How do I keep leading zeros?

Import the column explicitly as text, or convert the file to JSON where the value stays a string.

Can CSV hold nested data?

Not directly. Flatten nested keys into dotted column names, or use JSON instead.

Related terms

All terms

Related tools

Related guides

All guides