Convert JSON to CSV, including nested JSON
Paste JSON or drop a .json / .jsonl file below and download CSV. Fileshape finds the list of records inside the document, turns nested objects into columns named with dots (customer.city), joins simple arrays with semicolons and gives every record the same set of columns, so the result opens cleanly in Excel or imports into a database.
Your file
Stays on your device. Nothing is uploaded.
Drop a file hereChoose a file to convert
CSV, Excel, ODS, JSON, XML, YAML, HTML or Markdown tables. It stays on this device.
Finding the records
API responses rarely start with a plain array. They look like {"data": {"orders": [ … ]}} or wrap the list next to paging fields such as total and next. Fileshape searches the document for the largest array of objects and uses that as the rows, so you can paste a raw API response without trimming it first. A single object becomes a one-row table, and JSON Lines files (one object per line, common for logs and exports) are read line by line.
How nesting is flattened
A spreadsheet has no place for nested objects, so each nested field becomes its own column with a dotted name: {"customer": {"name": "Priya", "city": "Pune"}} gives the columns customer.name and customer.city. Arrays of simple values, such as tags, are joined into one cell with “; ” between items. Arrays of objects (an order's line items, for example) are kept as compact JSON text in a single cell, because spreading them across rows would duplicate the parent record.
Records don't need identical shapes. The column list is the union of every key seen, in the order first encountered, and missing values are left empty. That makes the output predictable even for loosely structured data from different API versions.
Going back from CSV to JSON
The dotted names are reversible. If you edit the CSV and convert it back to JSON, switch on Nest dot.keys into objects in step 4 and customer.name becomes a nested customer object again. Values come back as strings, which is the safe choice when IDs, phone numbers and postal codes must not lose leading zeros. Convert numbers explicitly with a formula if the consumer needs real numeric types.
FAQ
Questions
Is pasted JSON sent to a server?
No. Parsing and conversion happen in your browser, so it's safe for API responses containing customer data.
Can I get an Excel file instead of CSV?
Yes. Choose Excel (.xlsx) as the output format; the same flattening applies.
Does it handle JSON Lines / NDJSON?
Yes. Files ending in .jsonl or .ndjson, or pasted text with one object per line, are read as JSON Lines.
Related
Other conversions
- Convert Excel to CSV without breaking your dataConvert an Excel workbook to clean CSV in your browser: pick the sheet, skip title rows, keep leading zeros and choose comma or semicolon delimiters.
- Convert CSV to JSONTurn CSV into a JSON array of objects, nested JSON via dot-named columns, or JSON Lines. Delimiters and quoted fields detected automatically.
Updated 2026-11-20