We wrote the same 100,000-row dataset to CSV, TSV, JSON, JSONL, XML and SQL, then measured the file size (raw and gzipped) and how long popular parsers take to read it back.
In one line: JSON ended up 2.12x the size of CSV and XML 2.79x — but after gzip the difference shrank to 1.23x and 1.30x. Size alone is rarely a good reason to change format; the bigger differences are in readability by machines and people.
id, first_name, last_name, email, city, category, amount, notes), generated from a fixed seed so it can be reproduced.INSERT statements.papaparse, csvtojson, @fast-csv/parse and withdata-convert; JSON → CSV with json2csv and withdata-convert.| Format | Raw | vs CSV | gzip (level 6) | vs CSV (gz) |
|---|---|---|---|---|
| CSV | 7.5 MB | 1.00x | 1,542 KB | 1.00x |
| TSV | 7.5 MB | 0.99x | 1,539 KB | 1.00x |
| JSON | 16.0 MB | 2.12x | 1,898 KB | 1.23x |
| JSONL (NDJSON) | 16.0 MB | 2.12x | 1,898 KB | 1.23x |
| XML | 21.0 MB | 2.79x | 2,004 KB | 1.30x |
| SQL (INSERT) | 17.4 MB | 2.31x | 1,911 KB | 1.24x |
CSV writes the column names once, in the header row. JSON repeats a key on every row ("first_name":"John"), and XML goes further and wraps every value in its own element (<first_name>John</first_name>) plus a row element. That repeated structure is exactly why JSON is roughly 2x and XML roughly 3x the size of CSV for flat, tabular data.
The same repetition is also why gzip helps so much: the boilerplate compresses extremely well, so the real-world (compressed) penalty of JSON or XML is only about 20–30% — often not worth changing your pipeline for.
JSONL is the same size as a JSON array here, but it can be streamed line by line and appended to, which matters for logs and very large files.
| Library | Rows returned | Median | Best |
|---|---|---|---|
| papaparse | 100,001 ⚠ | 182 ms | 157 ms |
| csvtojson | 100,000 | 290 ms | 277 ms |
| withdata-convert | 100,000 | 614 ms | 509 ms |
| @fast-csv/parse | 100,000 | 776 ms | 771 ms |
All four finish 100,000 rows quickly enough for interactive use. Two things are worth noting:
| Library | Median | Best |
|---|---|---|
| json2csv | 167 ms | 166 ms |
| withdata-convert | 261 ms | 252 ms |
| Format | Best for | Watch out for |
|---|---|---|
| CSV / TSV | Flat tabular data, spreadsheets, database import, the smallest files | No types, no nesting, quoting rules vary |
| JSON | APIs, nested data, program-to-program exchange | ~2x the size of CSV; must load the whole document |
| JSONL / NDJSON | Streaming, logs, append-only files, huge datasets | Not human-friendly; one bad line can break a reader |
| XML | Legacy systems, documents with mixed content, SOAP, schemas | ~2.8x the size of CSV; verbose |
| SQL | Portable dumps you can restore into a database | Dialect differences; slower to generate/parse |
Yes — about 2.12x in our test (16.0 MB vs 7.5 MB). After gzip the difference falls to roughly 1.23x.
Yes, by about 1.3x (21.0 MB vs 16.0 MB), because XML wraps every value in a start and end tag.
A native JSON.parse is usually far faster than a general-purpose CSV parser, but a CSV file is smaller to read and transfer. For 100,000 rows, the CSV parsers we tested ranged from about 180 ms to 780 ms.
If you stream or append records — logs, event data, very large files — yes. JSONL keeps one object per line, so it is the same size as a JSON array but can be processed line by line.
Use the free online converters (they run entirely in your browser, nothing is uploaded): CSV to JSON, JSON to CSV, XML to CSV, CSV to SQL, and more. For large or batch jobs, use the offline desktop apps.
Everything above comes from a single script: generate 100,000 rows from a fixed seed, serialise each format, gzip level 6, and time each parser over 5 runs (median). Numbers will shift with the shape of your data, your CPU and your runtime version — treat them as a fair comparison under one consistent setup, not as universal constants.
If you just want the conversion done, the free online tools handle CSV, Excel, JSON, XML and SQL right in your browser: Withdata Online Data Conversion. For large files, batch conversion or scheduling, see the offline apps and the data conversion tools.