.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 type | Tabular |
|---|---|
| Human readability | High |
| Nesting support | No |
| LLM token efficiency | High |
| File extension | .csv |
| MIME type | text/csv |
| Best for | Spreadsheet 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
- Merging & Splitting Large CSV Files Locally Without Crashing ExcelCombine multi-file CSV exports by column header name or split oversized sheets into clean chunks with repeated headers and ZIP export locally.
- Why Excel Garbles UTF-8 CSVs — and How UTF-8 BOM Fixes ItStop Microsoft Excel from turning Chinese, Japanese, Korean, Spanish, and German CSV text into mojibake by adding a 3-byte UTF-8 BOM locally.
- How to Mask CSV & JSON Customer Data Before AI AnalysisAnonymize sensitive CSV columns, scale financial revenue proportionally (×k), and mask nested JSON keys locally in browser RAM without breaking file syntax.
- TXT, TSV & CSV to SQL: Clean Database Import WorkflowTurn whitespace or pipe-delimited TXT and TSV logs into RFC 4180 CSV, infer SQL column types, and generate batched PostgreSQL, MySQL, or SQLite SQL.
Related Formats
All 24 formatsCSV 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.