Data FormatsverifiedReviewed 2026-08-08

CSV

Comma-Separated Values · text/csv · .csv

Overview

CSV stores rows of comma-separated values and is described in RFC 4180. It is the lowest common denominator for tabular exchange, opening directly in Excel, Google Sheets, and most analytics tools.

Why three lines can contain one data record

Save this example with CRLF line endings. It contains a header and one shipment record. The note field contains both a comma and a line break, so its opening quote on the second line stays open until the third line.

id,note
17,"Leave at desk, east wing
Ask for ""Jo""."

A CSV reader returns the fields 17 and a single note with two lines. Its last line reads Ask for "Jo". The doubled quotes encode one literal quote on either side of the name. Splitting at every comma would create an extra column; treating every physical line as a record would invent an extra shipment.

In Python, open the file with newline="" and pass the file to csv.reader. Confirm that the header and data record each have two fields. If an import still shows extra rows, check its delimiter and quote settings before removing line breaks from the original note. RFC 4180, section 2 ยท Python CSV reader

Typical use cases

  • Spreadsheet export
  • Data pipelines
  • Flat data exchange
  • Bank and tool exports

Advantages

  • Plain text readable by any system
  • Small files for tabular data
  • Simple to produce from databases and APIs

Disadvantages

  • No types
  • Quoting edge cases
  • Not suitable for nested data

How to open or use it

Open CSV files in Excel, Google Sheets, LibreOffice Calc, a text editor, or any programming tool. Most spreadsheet apps import CSV directly with an encoding and delimiter step.