JSON to CSV converts an array of JSON objects, or a single object, into comma-separated rows you can open in Excel, Google Sheets, or Numbers. It is for analysts and developers who have an API response or a database export in JSON and need it as a table.
Input
[{"name":"Ada","city":"London"},{"name":"Grace","tags":["navy","cobol"]}]
Output
name,city,tags Ada,London, Grace,,"[""navy"",""cobol""]"
Input
[{"title":"Hello, world","quote":"She said \"hi\""}]
Output
title,quote "Hello, world","She said ""hi"""
Columns are the union of every key in every object, in the order they are first seen. In the first example, "tags" only exists on the second record, so it becomes the third column and the first row gets an empty cell there. Missing keys, null, and undefined all become empty cells, so rows with different shapes still line up under the right headers. Numbers and booleans are written as plain text, for example 24.99 and true.
Cell values follow the quoting rules of RFC 4180, the closest thing CSV has to a standard. A value is wrapped in double quotes only if it contains a comma, a double quote, or a line break, and any double quote inside it is doubled. That is why "Hello, world" is quoted and She said "hi" becomes "She said ""hi""". Values without those characters are written unquoted to keep the file readable. Rows are separated with a line feed, which Excel, Google Sheets, LibreOffice, and pandas all accept.
Nested objects and arrays are not flattened into extra columns. Each nested value is written as its JSON text inside one cell, so tags ["navy","cobol"] stays together and can be parsed back later. If you need one column per nested field, such as address.city, flatten the JSON in your code first or select the fields you need. Arrays of plain values, like [1, 2, 3], are rejected because they have no keys to use as headers.
Spreadsheet apps guess types when they open a CSV. Excel may drop leading zeros from postcodes and phone numbers, turn long IDs into scientific notation, or read 3-4 as a date. To keep values exactly as written, import the file with Data > From Text/CSV and set those columns to Text. Since the conversion runs in your browser, the file never leaves your computer. Validate tricky input first with the JSON validator, or tidy it with the JSON formatter.
More Developer Tools