CSV structure and the RFC 4180 standard
CSV (Comma-Separated Values) is a plain-text format for tabular data: each line is a record; commas separate fields. Despite its apparent simplicity, CSV has enough edge cases that the IETF formalised a specification in RFC 4180. Fields containing commas, line breaks, or double-quote characters must be wrapped in double quotes; a literal double-quote inside a quoted field is escaped as two consecutive double-quotes (""). These rules are consistently mishandled by hand-written exporters, which is why CSV files from different systems often fail to parse correctly in Excel or Python's csv module.
The most common CSV problems: the file uses a different delimiter (tabs, semicolons, or pipes) without declaring it; string values containing newlines break parsers that process line-by-line; inconsistent quoting (only some fields quoted) causes off-by-one column alignment; and character encoding issues (Windows-1252 vs UTF-8) corrupt accented characters. Paste your CSV here to view it as a formatted table and spot alignment problems before importing into a database or spreadsheet.
| Delimiter | Extension | Common source |
|---|---|---|
Comma , | .csv | Excel, Google Sheets, most databases |
Tab \t | .tsv | Unix tools, genomics data, some BI tools |
Semicolon ; | .csv | Excel in locales where comma is decimal separator (EU) |
Pipe | | .psv | Legacy financial systems, some ERPs |
CSV vs JSON vs XML for data exchange
CSV is the right format when the data is flat (one entity per row, no nesting) and the recipient is Excel, a BI tool, or a data analyst. JSON is better for nested structures and APIs. XML is required by legacy enterprise systems and document-oriented data. CSV has the smallest file size and fastest parse times for flat tabular data, but no standard way to represent null vs empty string, or to carry column type metadata, recipient systems have to infer types. If type fidelity matters, JSON or a typed format like Parquet is more reliable for data pipelines.
Related: JSON formatter, XML formatter, Number formatter for numeric columns.