All formats

CSV vs JSON

CSV is flat rows and columns, readable by every spreadsheet and database on earth, and untyped: everything is a string. JSON carries nesting and real data types, which is why APIs use it. Tabular data goes to CSV. Anything with structure inside a field goes to JSON.

Side by side

SpecCSVJSON
TypeDataData
Extensions.csv.json
Introduced1972 (RFC 4180 in 2005)2001 (ECMA-404 in 2013)
CompressionNoneNone
MIME typetext/csvapplication/json
Use it whenMoving tabular data between systems, or handling files too large for a spreadsheet.API payloads, configuration and any nested data structure.
Avoid it whenYou need formulas, formatting, multiple sheets or guaranteed types. Use XLSX.You need comments or anchors in config (use YAML), or flat tabular data (use CSV).

Where the usual answer breaks

Very large datasets. CSV streams row by row; a JSON array usually has to be parsed whole unless you use JSON Lines.

CSV

  • Readable by essentially every spreadsheet, database and language
  • Plain text, so it diffs and streams well
  • No practical size limit
  • No data types, so leading zeros and long numbers get mangled
  • No multi-sheet support, formulas or formatting
  • Delimiter, quoting and encoding conventions differ between tools
Full CSV guide →

JSON

  • Native support in virtually every programming language
  • Human-readable and simple to validate
  • Handles nested and hierarchical data cleanly
  • No comments, which makes it awkward for configuration files
  • No date type, so dates are strings by convention
  • Verbose compared with binary formats
Full JSON guide →

Convert between CSV and JSON

Tools for these formats

Other comparisons

Last updated 2026-08-03