JSON to CSV and CSV to JSON: Moving Data Between APIs and Spreadsheets
This converter turns JSON into CSV and CSV into JSON, in either direction, as you type. Paste your data, upload a file or drop one onto the input box, then copy or download the result. Everything runs in your browser, so nothing you paste is uploaded or stored.
What JSON and CSV Are
JSON (JavaScript Object Notation) is a text format for structured data: objects with named keys, arrays, strings, numbers, booleans and null. Most web APIs return it. CSV (comma-separated values) is a plain table with one record per line and one value per column, usually with a first line that names the columns. Spreadsheets, databases and reporting tools all read it. RFC 4180 describes the common rules, including how to quote values that contain commas, quotes or line breaks.
When to Convert
- Open API results in Excel or Google Sheets to sort, filter or build a pivot table.
- Import records into a database or CRM that only accepts CSV.
- Share a data set with colleagues who do not read JSON.
- Turn a spreadsheet export into JSON for a script, a test fixture or an API request.
JSON to CSV accepts an array of objects (one row per object), a single object (one row), an array of arrays, or an array of plain values (one column called value). Columns are the union of all keys in the order they first appear, so records with missing keys get empty cells.
How Nested Objects Are Flattened
CSV has no nesting, so a nested object has to become extra columns or text. With Flatten nested objects on, each nested key is joined to its parent with a dot. Arrays stay as JSON text in a single cell.
{"id": 1, "name": "Ana", "address": {"city": "Lisbon", "zip": "1000"}, "tags": ["admin", "beta"]}
id,name,address.city,address.zip,tags
1,Ana,Lisbon,1000,"[""admin"",""beta""]"
Turn the option off and the whole address object is written as JSON text in one column. The reverse direction does not rebuild nested objects: address.city stays a flat key in the JSON you get back.
Opening the CSV in Excel
Excel guesses the encoding of a CSV file, and without a hint it often misreads accents and non-Latin characters. The download button adds a UTF-8 byte order mark (BOM) so Excel reads them correctly. Copying the text and saving it yourself does not include the BOM.
Some European locales use a comma as the decimal separator, and Excel there expects semicolons between columns. If your data lands in a single column, choose Semicolon in the delimiter list and convert again. Google Sheets usually detects the delimiter by itself.
JSON vs CSV
| Feature | JSON | CSV |
|---|---|---|
| Structure | Nested objects and arrays | Flat rows and columns |
| Data types | Strings, numbers, booleans, null | Text only |
| Typical use | APIs, config files, code | Spreadsheets, imports, reports |
| File size | Larger, repeats key names | Smaller, header written once |
Reading CSV Correctly
The CSV parser follows RFC 4180. It handles quoted fields, doubled quotes ("") for a literal quote, delimiters and line breaks inside quotes, and both LF and CRLF line endings. A leading BOM is removed. The first row is the header, blank header cells become column_1, column_2 and so on, and short rows are padded with empty strings.