How to Convert JSON to CSV


CSV is the most portable tabular format: every spreadsheet, database, and BI tool reads it. This guide explains how JSON becomes CSV and how nested data is handled.


Why convert JSON to CSV?


JSON is ideal for APIs and programs, but analysts, finance teams, and spreadsheet tools want rows and columns. CSV is the lowest-common-denominator format that imports everywhere.


How nesting is flattened


An object like:


{ "id": 1, "user": { "name": "Asha", "city": "Jalaun" } }


becomes three columns: id, user.name, user.city. This dot-notation flattening works to any depth, so deeply nested API responses turn into a flat table you can sort and filter.


How arrays are handled


  • Arrays of scalars (["a","b","c"]) are joined into a single cell: a, b, c
  • Arrays of objects are written as JSON text in the cell, so nothing is lost

  • Wrapper objects


    If your JSON is wrapped, like {"data": [ ... ], "meta": { ... }}, the converter finds the records array automatically (it knows common keys like data, results, items, rows).


    CSV vs XLSX


    CSV is universal, but Excel can reformat CSV values on open (stripping leading zeros, turning long numbers into scientific notation). If your data has IDs, ZIP codes, or long numbers, download as XLSX instead: it writes those as text cells so they survive exactly.


    Tips


  • Use the Paste tab for quick conversions of an API response.
  • Open the CSV with Data > From Text/CSV in Excel and set columns to Text to avoid reformatting.