.csv · text/csv

CSV: Comma-Separated Values

CSV (RFC 4180) stores tabular records as delimited plain-text lines with optional quoted fields for embedded commas and newlines.

Quick Answer: CSV (RFC 4180) stores tabular records as delimited plain-text lines with optional quoted fields for embedded commas and newlines. Spreadsheet imports, analytics exports, SQL table loads, and uniform flat datasets.

Structure typeTabular
Human readabilityHigh
Nesting supportNo
LLM token efficiencyHigh
File extension.csv
MIME typetext/csv
Best forSpreadsheet imports, analytics exports, SQL table loads, and uniform flat datasets.

Strengths

  • Minimal syntax overhead keeps file sizes and LLM token counts compact
  • Opens in Excel, Google Sheets, PostgreSQL COPY, and Python pandas
  • Streams line by line with almost zero memory overhead

Trade-offs

  • No built-in encoding header causes Excel to garble UTF-8 text without a BOM
  • Does not natively represent nested objects or hierarchical trees
  • Every cell is plain text unless consumers infer numbers and booleans

References

Convert & clean CSV locally

Related engineering guides

Related Formats

All 24 formats

CSV frequently asked questions

Why does Microsoft Excel show garbled Chinese or accented text in CSV files?

Windows Excel assumes CSV files without a 3-byte UTF-8 BOM (EF BB BF) use your system's legacy ANSI or GBK code page. Prepending a UTF-8 BOM fixes Excel imports instantly.

Comma vs. semicolon delimiter in European locales?

Regions that use commas as decimal separators often expect semicolons in CSV exports. Auto-detecting or choosing explicit delimiters avoids merged columns.

How should commas or line breaks inside a CSV cell be escaped?

Per RFC 4180, wrap any field containing delimiters, quotes, or newlines in double quotes and double any literal quote inside the value.