Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Convert a JSON array of objects into CSV, ready for a spreadsheet.
name,city
John,New York
Jane,BostonThis tool converts a JSON array of objects into CSV -- the format spreadsheet apps like Excel and Google Sheets expect. It builds the header row from the union of every object's keys, so it handles arrays where individual objects have slightly different (or missing) fields.
Paste a JSON array of objects. The resulting CSV appears with a header row and one data row per array item.
The header row is built from the union of all keys across every object in the array. Any field a given object is missing becomes an empty cell for that row. A field's value is wrapped in quotes (with internal quotes doubled) if it contains a comma, quote, or newline, per standard CSV escaping rules.
[{"a":1,"b":2},{"a":3,"c":4}] converts to a CSV with header a,b,c -- the first row shows 1,2, (empty c) and the second shows 3,,4 (empty b).
To go the other direction, see the CSV to JSON Converter.
The header row lists keys in the order they are first encountered, scanning the array from the first object to the last. That means the first object decides the leading columns, and any key that appears only in later objects is added on the right. In the page's own example the header is a, b, c because a and b appear first and c is discovered in the second object. If a column order matters to you, put an object with all the keys in your preferred order first in the array. Missing keys and values that are null or undefined produce empty cells. A value of 0, false or an empty string is different: those are kept, with 0 written as 0 and false written as the word false.
The converter is designed for flat objects. If a value is itself an object, it is converted using plain string conversion, which produces the text [object Object] in the cell, and that loses the data. If a value is an array, its items are joined with commas, so the array of two tags red and blue becomes the text red,blue; because that text contains a comma, the cell is automatically wrapped in quotes. To keep nested data, flatten it before converting: for example, replace an address object with separate street and city fields on the parent, or join array items yourself with a different separator such as a pipe character. Then paste the flattened array.
A cell is wrapped in double quotes when it contains a comma, a double quote or a line break, and any double quotes inside it are doubled. So a value written as He said "hi" appears as "He said ""hi""". Cells without those characters are written bare. The header names follow the same quoting rules. Spreadsheet applications read this format correctly, and the doubled quotes come back as single quotes when opened.
If an array contains items that are not objects, for instance plain numbers or strings mixed with objects, those items contribute no columns, and their row is written with empty cells. Arrays of plain values are therefore not a good fit for this converter. Wrap each value in an object such as one with a single key called value before converting.
Check that the number of data lines equals the number of objects in your input, and scan the header for unexpected extra columns, which typically reveal a misspelled key in one object. Because the tool always uses commas, if your spreadsheet software expects semicolons in your regional settings, use the CSV Delimiter Converter afterward, or import the file using the comma option.
They're converted to their string representation (e.g. via String()) rather than expanded into additional columns -- for deeply nested data, flatten it manually first for a cleaner CSV.
Yes -- the top-level JSON value must be a non-empty array of objects; a single object or a different structure won't produce a meaningful CSV.
Any value containing a comma, quote, or newline is automatically wrapped in double quotes (with internal quotes doubled), so it opens correctly in Excel or Google Sheets.
Nested objects are converted with plain string conversion, which loses their contents. Flatten the data into simple fields first.
Columns follow the order keys first appear in the array, so place an object with all your keys in the preferred order first.
Null and missing values both produce an empty cell. Values of 0, false and empty text are kept.
The input must be a non-empty array. Wrap a single object in square brackets to convert it.
Reference: MDN Web Docs