Comma-Separated Values

Comma-separated values, or CSV, is a plain-text file format for tabular data in which each line represents a row and commas separate the values within that row, with the first line conventionally (though not universally) holding column headers. Its defining property is also its greatest practical strength: a CSV file is just text, readable and writable by essentially every programming language, spreadsheet application, and database system in existence without needing any specialized library or proprietary format support, which has made it the closest thing data exchange has to a universal lowest common denominator since well before the format was ever formally standardized.

CSV predates any formal standard by decades — informal comma-delimited text export was already common practice by the late 1970s, used by early spreadsheet and database tools — and it wasn't until 2005 that RFC 4180 attempted to codify a consistent specification for the format, by which point countless applications had already implemented their own slightly incompatible variations. This history is the direct cause of CSV's most persistent practical headache: because no single authority enforced the format from the start, there's no universal agreement on how to handle a comma that appears inside a field's actual value (the convention is to wrap such fields in double quotes, but not every tool implements this consistently), what character separates rows across different operating systems (line-ending conventions differ between Windows and Unix-based systems), or what text encoding a file uses (UTF-8, Latin-1, and others are all still in active use, and a file with no declared encoding leaves the reading application to guess).

CSV file
plain text, rows as lines, values comma-separated
Recurring parsing ambiguities
Commas inside a value
e.g. an address — should be quoted, not always is
Line-ending differences
Windows CRLF vs Unix LF
Encoding ambiguity
UTF-8 vs Latin-1 vs undeclared
No enforced data types
every value is just text until something parses it
"Looks tabular" is not the same as "structured"
no schema is actually enforced

CSV has no inherent data types and no enforced schema — every value in a raw CSV file is, strictly speaking, text, and it's entirely up to whatever application opens the file to infer that a column is numeric, a date, or a boolean, a step that can silently go wrong. A classic, widely-documented example is Excel automatically reinterpreting gene names or product codes that happen to look like dates (a gene named "SEPT2" being silently converted to a date, a documented enough problem that it has led some scientific journals and the HGNC gene nomenclature committee to formally rename affected gene symbols specifically to avoid this spreadsheet-software misinterpretation). This is the practical reason CSV is more accurately classified as semi-structured rather than structured data despite its row-and-column appearance: nothing in the format itself enforces that a column stays consistently typed, quoted, or formatted across every row.

More structured and more capable alternatives to CSV exist specifically to address its limitations, and the choice between them is a real engineering decision rather than a matter of preference. TSV (tab-separated values) swaps commas for tabs, sidestepping the in-value-comma ambiguity at the cost of a different, rarer ambiguity around literal tab characters. JSON supports nested structure and explicit typing that flat CSV cannot represent. Parquet and other columnar binary formats add compression, enforced schemas, and far faster read performance for large-scale analytical workloads, at the cost of no longer being human-readable as plain text. CSV's continued dominance despite all of these more capable alternatives comes down to exactly the property that made it popular in the first place: it requires no special tooling to read, write, or inspect, which keeps it the default choice for data exchange between systems that otherwise share nothing in common.

Reading and writing CSV reliably in practice almost always goes through a dedicated parsing library (Python's built-in csv module or the widely used pandas library, for instance) rather than naive manual string splitting on commas, because a hand-rolled parser that simply splits every line on commas will silently produce wrong results the moment a field contains an embedded comma inside quotes — a subtle, common bug that a proper CSV parser, which understands the quoting convention, is specifically built to avoid.

Read CSV as the format that won on universality rather than rigor: its plain-text simplicity is why it remains the default for data exchange across virtually every system, but that same simplicity — no enforced types, no formally agreed quoting and encoding rules until decades after informal use was already widespread — is the direct cause of the format's most common real-world failures, from Excel's infamous gene-name misreads to silent parsing errors from any tool that doesn't correctly handle a comma embedded inside a quoted field.

Take comma-separated values further

Ask the copilot about this term, or have our engineers assess it against your process.