What is CSV?
CSV (Comma-Separated Values) is a plain text format that stores tabular data as rows of values separated by commas, making it the most universal format for exchanging spreadsheet and database data between applications.
Last updated:
What is CSV?
CSV (Comma-Separated Values) is a plain text format that stores tabular data as rows of values separated by commas, making it the most universal format for exchanging spreadsheet and database data between applications.
Understanding CSV helps you choose the right format for your specific needs and workflow.
How CSV Structures Data
Each line in a CSV file represents one record, and fields within a record are separated by commas; an optional header line names the columns.[1] Fields that themselves contain commas, line breaks, or double quotes are enclosed in double quotes, and a literal double quote inside such a field is escaped by doubling it ("").[1] The format carries no data types, formulas, or styling, so every value is ultimately just text that consuming applications must interpret.[3]
Standardization
CSV circulated informally for decades before being documented in 2005 as RFC 4180, which the IETF published as an informational memo rather than a binding standard.[1] The Library of Congress recognizes RFC 4180 as the closest thing to a CSV specification while noting that the format long predates it and that many real-world files deviate from it.[2]
Common Pitfalls
Because no single authority governed early implementations, CSV files vary widely in practice: some use semicolons or tabs as delimiters (common in locales where the comma is a decimal separator), encodings differ from file to file, and quoting conventions are inconsistent.[3] These ambiguities, combined with the lack of explicit typing, mean CSV is excellent for interchange but unreliable for preserving the exact structure of a spreadsheet.[2]
CSV Technical Specifications
CSV vs Other Spreadsheet & Data Formats
| Feature | CSV | XLSX | JSON |
|---|---|---|---|
| Structure/type | Delimited text[1] | Zipped XML | Nested text |
| Formatting/formulas | None[3] | Yes | None |
| Data shape | Flat table | Multi-sheet | Hierarchical |
| Standardized by | IETF (RFC 4180)[2] | ECMA / ISO | ECMA / IETF |
| App support | Universal | Broad | Broad |
| Best for | Tabular interchange | Rich spreadsheets | Structured data |
CSV is a simple flat-table interchange format, while XLSX adds formatting and formulas and JSON handles nested data.
Advantages & Disadvantages
Advantages
Every spreadsheet app, database, and programming language can read and write CSV without special libraries.
CSV is plain text - you can open and edit it in any text editor and immediately understand the data.
No formatting, no metadata - CSV files are extremely compact compared to XLSX or database exports.
Any application or script can produce valid CSV with a simple loop, making it ideal for data exports.
Disadvantages
Everything is stored as text - dates, numbers, and booleans must be interpreted by the receiving application.
CSV stores only raw data - no bold text, colors, merged cells, or any visual formatting.
Special characters and non-ASCII text often cause problems when files are opened in different locales.
CSV cannot represent relational data or multiple tables - you need multiple files or a different format.
Common Use Cases
Here are the most common scenarios where CSV is the right choice:
Database Exports
Exporting database tables to CSV for backup, analysis, or migration to another system.
Data Analysis
Input format for Python pandas, R, Excel, and virtually every data analysis tool.
CRM and Marketing Data
Contact lists, email subscriber exports, and sales data shared between marketing tools.
Application Integration
Moving data between applications that do not share a native integration or API.
Convert CSV Files Online - Free
Compress, convert, or optimize your CSV files instantly. No software to install, no registration required.
Try Document Converter FreeFrequently Asked Questions
What is the difference between CSV and Excel?
CSV is plain text with just data. Excel (XLSX) includes formatting, formulas, multiple sheets, and charts. CSV is for data portability; XLSX is for spreadsheet work.
Why does my CSV look wrong in Excel?
Usually an encoding issue (UTF-8 vs ANSI) or delimiter mismatch. Use Data > From Text/CSV import in Excel to specify encoding.
Can CSV have commas in the data?
Yes - values containing commas must be wrapped in double quotes. Most CSV parsers handle this automatically.
What encoding should I use for CSV?
UTF-8 with BOM is safest for international characters and Excel compatibility. Pure UTF-8 works best for programming use.
Is TSV better than CSV?
TSV (tab-separated) avoids comma conflicts in data but is less universally supported. For most use cases, CSV is the safer choice.