← Home

JSON ⇄ CSV

Convert an array of JSON objects to CSV, collecting every key that appears across all objects as the header row, or turn CSV back into JSON using the first row as keys. Quoted fields containing commas, line breaks or escaped double quotes are parsed properly rather than split naively on commas.

Direction
Input

How does the conversion work?

JSON → CSV expects an array of objects (or a single object). It collects every key that appears across all objects as the header row, then writes one row per object; nested objects/arrays inside a value are kept as a JSON string in that cell rather than flattened. CSV → JSON uses the first row as headers and turns every following row into an object — it correctly handles quoted fields that contain commas, line breaks, or escaped double quotes (""), not just a naive comma split.

How to use the JSON ⇄ CSV Converter

  1. Choose a direction — under "Direction", pick JSON → CSV or CSV → JSON.
  2. Provide input — paste your data into the input box, or use "Load File" to open a .json or .csv file (the direction is set automatically from the extension).
  3. Convert — press the "Convert" button and the result is produced instantly inside your browser.
  4. Copy or download — copy the result to your clipboard or download it as a file.

How are nested objects and arrays handled?

CSV is a flat, tabular format, so it can't represent nesting. That's why, during a JSON → CSV conversion, a value that is an object or array isn't arbitrarily flattened — instead the cell keeps the JSON string (like {"...":...}) so no data is lost. Conversely, in CSV → JSON, if a cell is a valid JSON string it comes back to life as a structured value. The flatter your data is, the cleaner both directions convert.

How is the header (first row) handled?

On JSON → CSV, the keys that appear across all objects are gathered into the first-row header, and cells are left blank for keys an object doesn't have. On CSV → JSON, the first row is treated as the header and each column name is used as an object key, so the first row must contain the column titles for the data to map correctly.

When would I use this?

Useful for turning an API's JSON response into a spreadsheet-friendly CSV, or conversely importing a CSV exported from a spreadsheet or database tool into JSON for use in code. If you'd also like to pretty-print or validate the JSON side, try the JSON Formatter.

Is my data sent to a server?

No. Parsing and converting the data you paste or load all happens inside your browser, and no file or text is ever sent to or stored on any server. It works even without an internet connection, so you can safely convert sensitive data.