Convert JSON to CSV
Turn JSON files into CSV. A list of objects becomes one row per object under a header of every key in first-seen order, and a single object becomes one row.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop JSON files on the dialor turn it to pick what to do
A JSON list turned into a table.Each object becomes one row, with a column for every key.
What you get
A CSV file with a header row and one row per object. The header lists every key in the order it first appears in the data.
A single object, not a list, becomes one row under its own keys.
Nested values and nulls
CSV has no place for nested data. An object or a list inside another object is written into its cell as JSON text, so the cell holds the whole value.
A null leaves its cell empty.
When it stops
The conversion stops with
input_corruptedwhen the file could not be parsed. That means the file is not valid JSON.To go the other way, use CSV to JSON.
JSON and CSV.What each format is.
The formats
JSON
JSON, the data format of every API.
- Extensions
- .json
- MIME type
- application
/json - Kind
- Text and data
CSV
Rows of comma-separated values. The plainest way to move a table between programs.
- Extensions
- .csv
- MIME type
- text
/csv - Kind
- Text and data
In your code.The same JSON to CSV conversion through the API, for your app or your agent.
$ cv convert report.json report.csv$ cv convert report.json report.csvQuestions.What people ask about JSON to CSV.
The header holds every key found in the objects. They appear in the order each key is first seen.
They are written into their cell as JSON text. The nesting is not split into extra columns.
The cell is left empty.
It becomes a CSV with one row, under a header of that object's keys.