CSV vs JSON
CSV vs JSON: which format to use for your data
CSV (RFC 4180) stores a flat table as text with one header row, while JSON (RFC 8259) stores typed values, nested objects and arrays. rows.page opens both formats up to 1.5 GB in your browser and converts either way, free with no signup.
No file handy? Open CO2 emissions by country and year (50k rows, 14 MB).
CSV vs JSON: which should you use?
CSV
- Every record has the same flat fields, with no lists or sub-objects.
- The file goes to Excel, Google Sheets or a database import.
- You want a compact text file, since the column names appear only once.
JSON
- Records hold nested objects, lists, or fields that only some records have.
- The data comes from or goes to a web API.
- Readers must tell
1,"1",trueandnullapart without guessing.
For millions of records, two other formats often fit better: JSONL keeps JSON's structure with one record per line, and Parquet stores typed columns in a compressed binary file. rows.page opens and exports both.
What do the same records look like in CSV and JSON?
Here are three records as CSV, with the column names once on the first line:
id,name,active,city
1,Alice,true,Amsterdam
2,Bob,false,Berlin
3,Cara,true,And the same records as a JSON array of objects, with the city inside a nested address object:
[
{"id": 1, "name": "Alice", "active": true, "address": {"city": "Amsterdam"}},
{"id": 2, "name": "Bob", "active": false, "address": {"city": "Berlin"}},
{"id": 3, "name": "Cara", "active": true, "address": {"city": null}}
]In the CSV, every value is text and Cara's missing city is an empty field at the end of line 4. In the JSON, numbers and booleans are unquoted, the missing city is an explicit null, and every key repeats in every record.
How do CSV and JSON differ?
| Property | CSV | JSON |
|---|---|---|
| Structure | Flat rows and columns | Nested objects and arrays |
| Data types | None: every value is text | Strings, numbers, booleans, null, arrays, objects |
| Missing value | Empty field | null, or the key is left out |
| Column names | Once, in the header row | Repeated in every object |
| Typical use | Spreadsheets and database imports | Web APIs and configuration |
| Specification | RFC 4180 (2005, informational) | RFC 8259 (2017) and ECMA-404 |
| Media type | text/csv | application/json |
Because CSV has no types, every reader guesses them. DuckDB, for example, samples the file and reads id as a number and active as a boolean, while Excel keeps only 15 significant digits, so long numeric IDs can lose digits. JSON writes the type into the file: 1 is a number and "1" is a string.
RFC 4180 is informational: it documents the common practice of a comma between fields and double quotes around values that contain commas, quotes or line breaks, and many tools still write semicolons, tabs or pipes instead. JSON has one grammar, defined by RFC 8259 and ECMA-404.
How do you convert CSV to JSON?
rows.page
- Drop a
.csvor.txtfile on rows.page, or click Paste data and paste cells copied from Excel or Google Sheets. The delimiter (comma, semicolon, tab or pipe) and the header row are detected for you. - Optionally filter rows, for example with
price:>20, or run SQL against the tabledata. - Open Export and pick JSON for one array of objects keyed by the header row, or JSONL for one object per line.
DuckDB-WASM reads the file in your browser, so nothing is uploaded unless you press Share.
DuckDB
COPY (SELECT * FROM 'data.csv') TO 'data.json' (FORMAT JSON, ARRAY true);Without ARRAY true, DuckDB writes one object per line, which is JSONL.
How do you convert JSON to CSV?
rows.page
- Drop a
.json,.jsonl,.ndjsonor.ldjsonfile on rows.page, or paste it. - A single top-level object such as
{"data": [...]}is unwrapped to its biggest list, up to 4 levels deep, with a note that the other top-level fields were skipped. - Nested objects become dot-path columns such as
address.city, up to 8 levels deep and 200 child fields per object, and arrays stay list columns that show the first 6 items and "+N". - Open Export and pick CSV.
The CSV is comma-delimited UTF-8 without a BOM, and cells that start with =, +, -, @, a tab or a carriage return get a leading apostrophe so spreadsheets don't run them as formulas. To query a nested field first, put the dot-path column in double quotes, as in SELECT "address.city" FROM data.
DuckDB
COPY (SELECT id, name, active, address.city AS city FROM 'data.json') TO 'data.csv' (HEADER);Name nested fields explicitly, as with address.city here, so each one gets its own CSV column.
rows.page limits and prices
| What | Limit or price |
|---|---|
| Open a file in your browser | Files up to 1.5 GB, $0, no account, nothing uploaded |
| Share a link without an account | $0, files up to 100 MB, link deleted 7 days after creation |
| Free account | $0, 10 datasets kept, last 3 versions |
| Pro | $12/month, 100 datasets, files up to 500 MB, private links |
| Max | $39/month, 1,000 datasets, files up to 2 GB, private links |
Questions
Is JSON bigger than CSV for the same data?
Usually, yes. JSON repeats every key in every record and quotes every string, while CSV writes the column names once, so the gap grows with long key names and many rows.
Can a CSV file hold nested data?
Not directly. A CSV cell is plain text, so nested objects have to be flattened into extra columns such as address.city, or stored as JSON text inside one cell. rows.page expands such a JSON-text column automatically when at least 90% of its values in the first 1,000 rows are JSON objects.
Does converting JSON to CSV and back keep the nesting?
Not in rows.page: nested objects become dot-path columns such as address.city, and a JSON or JSONL export keeps those dot-path keys instead of nesting them again, while lists stay real arrays. Use jq or DuckDB if you need the original tree.
What is the largest CSV or JSON file rows.page can open?
Up to 1.5 GB per browser tab, with no row limit. A bigger CSV, TSV or JSONL file loads its first rows with the note "Loaded the first N rows: the file is X, more than the browser can hold.", while a bigger .json file is refused with "Too big for this browser".
Which text encodings does rows.page read for CSV files?
UTF-8, and UTF-16 when the file starts with a byte order mark ("Read as UTF-16 text."). Anything else is read as Latin-1 ("Read as Latin-1 text."), but a byte from 0x80 to 0x9F, such as a Windows-1252 euro sign or curly quote, stops the file from opening, so re-save it as CSV UTF-8. Exports are always UTF-8 without a BOM.