How to convert JSON to CSV
- Choose a .json or .jsonl file, or paste the JSON.
- If your JSON is an object (like an API response with a "data" list), check that "Rows" shows the list you want.
- Choose the delimiter, then download the CSV or copy it.
Without a converter
With jq on the command line, a flat list of objects converts with jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]]) | @csv' data.json.
It uses the first record's fields only, and nested objects need extra work. In Python, pandas.json_normalize(data).to_csv("out.csv", index=False) flattens nested objects
the same way this converter does (but reads long IDs as floating-point numbers unless told otherwise).
Excel can import JSON with Power Query (Data → Get Data → From File → From JSON) and then save as CSV; see JSON to Excel. Google Sheets can't import JSON files.
Questions
- How are nested objects and arrays handled?
- Nested objects become columns with dotted names ({"user": {"name": "Ann"}} → user.name). Arrays become one column per item (tags.0, tags.1) by default; you can instead put all items in one cell, separated by commas, or make one row per item with the record's other values repeated.
- What happens to records with different fields?
- Every field found in any record becomes a column; records without it leave that cell empty. Columns are in the order fields first appear.
- Are numbers changed?
- No. Numbers are written exactly as they are in the JSON, including IDs longer than 15 digits and trailing zeros like 1.50. true, false and null become true, false and an empty cell.
- Which delimiter should I use?
- Comma, unless the CSV is for Excel in a country that writes decimals with a comma (much of Europe and South America): there Excel expects semicolons. Tab gives a TSV file. Values containing the delimiter, quotes or line breaks are quoted, as the CSV standard says.
- Does my JSON get uploaded?
- No, it is converted in your browser. You can also paste JSON, and copy the CSV result to the clipboard.
Related tools
- JSON to Excel Converter (XLSX) Convert JSON to an Excel XLSX file online. Nested objects become columns, long IDs and leading zeros are kept. Free, and your file never leaves your computer.
- XML to CSV Converter Convert XML to CSV online: pick the repeating element, and attributes and child elements become columns. Free, private: the file never leaves your computer.
- Convert CSV, Excel, JSON and XML Files Convert between CSV, Excel, JSON and XML online without losing leading zeros, long IDs or dates. Free; your files are converted in your browser, never uploaded.