CSV
By General computing convention
CSV, or comma-separated values, is a plain-text file format for storing tabular data where each line represents one row and fields within a row are separated by commas. It has no single formal owner or mandatory schema, making it one of…
Definition
CSV, or comma-separated values, is a plain-text file format for storing tabular data where each line represents one row and fields within a row are separated by commas. It has no single formal owner or mandatory schema, making it one of the simplest and most widely supported ways to exchange spreadsheet-like data between different applications, databases, and programming languages, though its lack of strict standardization leads to real-world variation in how special characters and quoting are handled.
Overview
Long before richer structured formats existed, applications needed a simple way to move tabular data, rows and columns of values, between spreadsheets, databases, and custom programs, and CSV emerged as a de facto convention rather than a formally designed format: write each row on its own line, separate its fields with commas, and let any program that understands this simple rule read the data back. Its simplicity, more than any technical sophistication, is what made it durable across decades of computing. Mechanically, a CSV file is just text, with a newline marking the end of each row and a delimiter, typically a comma, separating fields within that row. Complications arise when a field itself contains the delimiter, a newline, or quote characters, which is handled by wrapping such fields in double quotes and doubling any literal quote characters inside them, a convention later formalized, non-bindingly, in RFC 4180. Because CSV predates that specification and many tools implement quoting, encoding, and delimiter choices slightly differently, files labeled CSV in the wild show meaningful variation, including semicolon-delimited variants common in regions where the comma is a decimal separator. CSV differs from richer data formats like JSON or XML in that it has no native way to represent nested structures, data types, or hierarchical relationships, everything is flat rows of text, which is precisely why it remains the lowest common denominator for tabular data exchange: nearly every spreadsheet application, database, and programming language can read and write it without specialized libraries, unlike more expressive formats that require a parser aware of their particular schema and type system. In practice, CSV is the default export and import format for spreadsheets, database query results, and data science workflows, where tools such as pandas in Python or built-in database utilities read and write CSV routinely as an interchange point between systems that otherwise share no common data format. It also remains common in log files, scientific datasets, and configuration exports where a simple, universally readable tabular format matters more than expressiveness. The format's core limitation is exactly its simplicity: it has no standard way to express data types, so every value is ambiguous text until a reader decides how to interpret it, no native support for nested or relational data, and inconsistent handling of edge cases like embedded newlines or non-comma delimiters across different tools. For data that needs strong typing, nested structures, or strict validation, formats like JSON, Parquet, or a proper database schema are generally preferred over CSV.
Specification
- Stores tabular data as plain text, one row per line
- Separates fields within a row using a delimiter, typically a comma
- Requires no specialized software to read or write
- Supported natively by nearly every spreadsheet and database tool
- Uses double-quote wrapping to handle delimiters within fields
- Has no native support for nested or typed data
- Loosely standardized by the non-binding RFC 4180
- Widely used as the lowest common denominator for data exchange