Skip to content

JSON Array to CSV Converter

Paste an array of objects and get one CSV line per object, with a column for every key found anywhere in the array.

Runs in your browserFree, no sign-upLast reviewed

Settings

Results update automatically as you type.

CSV

id,name,role
1,Ada,Engineer
2,Grace,Admiral

Summary

Rows
2
Columns
3

Quick answers

How do I convert a JSON array to CSV?
Take the keys of the objects as column names, write them as the first line, then write one line per object with its values in the same column order, quoting any value that contains the delimiter. Paste the array above and the CSV is produced for you to copy or download.
What happens if the objects have different keys?
Every key seen in any object becomes a column, in the order each key first appears. An object that lacks a key gets an empty cell in that column. For example {"id":1,"name":"Ada"} and {"id":2,"email":"grace@example.com"} give the columns id,name,email.
How are nested objects and arrays converted to CSV?
They are not flattened into separate columns. A nested value is written into one cell as compact JSON text, so {"tags":["a","b"]} gives the cell "[""a"",""b""]". Flatten the JSON yourself first if you need a column such as address.city.
Why does Excel put my whole CSV in one column?
Excel splits on the list separator set for your region. Where the comma is the decimal mark, as in much of Europe, that separator is a semicolon, so a comma-separated file lands in column A. Convert again with Delimiter set to Semicolon.
Can I convert a single JSON object instead of an array?
Yes. A single object is treated as an array with one item, so {"id":7,"name":"Solo"} becomes the header id,name and the row 7,Solo. Its top-level keys are the columns.
How do I get TSV instead of CSV from JSON?
Set Delimiter to Tab. Tab-separated text pastes directly into Excel or Google Sheets cells without an import step, and values containing commas no longer need quoting.

How JSON to CSV Converter works

This converter turns a JSON array of objects into CSV: each object becomes one row and each distinct key becomes one column. The default input, [{"id":1,"name":"Ada","role":"Engineer"},{"id":2,"name":"Grace","role":"Admiral"}], produces the header id,name,role followed by 1,Ada,Engineer and 2,Grace,Admiral. Columns are collected from every object, not just the first, so records with missing keys get empty cells and stay aligned. Values containing the delimiter, a double quote or a line break are quoted automatically. Nested objects and arrays are not flattened; they are written into a single cell as JSON text.

JSON array to CSV examples

Each result is the exact output of the converter. Line breaks in the CSV are shown as a slash.

Array of flat objects (the default input)

[{"id":1,"name":"Ada","role":"Engineer"},{"id":2,"name":"Grace","role":"Admiral"}]

id,name,role / 1,Ada,Engineer / 2,Grace,Admiral

Summary: Rows 2, Columns 3.

Objects with different keys

[{"id":1,"name":"Ada"},{"id":2,"email":"grace@example.com"},{"name":"Linus","id":3,"phone":"555-0100"}]

id,name,email,phone / 1,Ada,, / 2,,grace@example.com, / 3,Linus,,555-0100

Four columns from three objects. The third object lists name before id, but the column order was already fixed by the first.

Values with a comma, quotes and a line break

[{"name":"Smith, John","quote":"He said \"hi\"","address":"12 High St (line break) Leeds","plain":"ok"}]

name,quote,address,plain / "Smith, John","He said ""hi""","12 High St (line break) Leeds",ok

The quoted address spans two physical lines in the file but is still one record.

Nested array and nested object

[{"id":1,"tags":["a","b"],"address":{"city":"Leeds","zip":"LS1"}}]

id,tags,address / 1,"[""a"",""b""]","{""city"":""Leeds"",""zip"":""LS1""}"

Three columns, not five. The nested values survive intact as JSON text.

Semicolon delimiter

[{"sku":"A-100","price":12.5,"desc":"Red, large"},{"sku":"B-200","price":7.99,"desc":"Blue; small"}] with Delimiter set to Semicolon

sku;price;desc / A-100;12.5;Red, large / B-200;7.99;"Blue; small"

Only the value containing a semicolon is quoted. Numbers keep the dot as the decimal point.

Include header row unticked

The default input

1,Ada,Engineer / 2,Grace,Admiral

How each JSON value type is written to a CSV cell

JSON valueCSV cellNotes
"Ada"AdaStrings are written without quotes unless they need them
"Smith, John""Smith, John"Quoted because it contains the delimiter
4242Numbers are written as plain digits
-3.50-3.5Trailing zeros are not part of a JSON number and are dropped
1e211e+21Very large numbers come out in exponent notation
1234567890123456789012345678901234567000Integers above 9007199254740991 lose precision; send long IDs as strings
"007"007A string keeps its leading zeros in the file
true / falsetrue / falseLowercase words
null(empty)An empty cell, not the text null
key missing from the object(empty)Identical to null in the output
""(empty)An empty string also gives an empty cell
" padded " padded Leading and trailing spaces are kept and not quoted
["a","b"]"[""a"",""b""]"Arrays become JSON text in one cell
{"city":"Leeds"}"{""city"":""Leeds""}"Objects become JSON text in one cell

CSV has no types. The file stores 007 correctly, but a spreadsheet that opens it may still display 7 unless you import that column as text.

Which delimiter to choose

DelimiterOutput for the default inputUse it when
Commaid,name,role / 1,Ada,EngineerImporting into databases, CRMs, ad platforms and most tools that ask for CSV
Semicolonid;name;role / 1;Ada;EngineerOpening the file by double-click in Excel where the comma is the decimal separator
Tabid, name, role separated by tab charactersPasting straight into spreadsheet cells, or when many values contain commas
Pipeid|name|role / 1|Ada|EngineerFeeding systems that expect pipe-delimited files, or text full of commas and semicolons

Whichever delimiter you pick, a value containing that character is wrapped in double quotes. With Pipe selected, the value a | b is written as "a | b".

Inputs that are rejected or give a surprising result

InputWhat you getWhat to do
[[1,2],[3,4]] (array of arrays)Error: Every item in the array must be a plain object.Turn each inner array into an object with named keys
["a","b"] (array of strings)The same errorWrap each value, for example [{"value":"a"},{"value":"b"}]
[] (empty array)Error: The JSON array is empty, so there is nothing to convert.Paste an array with at least one object
{"data":[{"id":1},{"id":2}],"total":2}One row with the columns data and total; the whole list sits in the data cell as JSON textPaste only the inner array, the part inside the square brackets
[{'id':1}] (single quotes)Invalid JSON error with the browser's description of the problemUse double quotes around keys and strings
[{"id":1},] (trailing comma)Invalid JSON errorRemove the comma before the closing bracket
[{"last, first":"x","b":1}] (key containing the delimiter)Header line last, first,b, which reads as three columns over two-column rowsRename the key or choose a delimiter the key does not contain; header names are not quoted

Opening the CSV in Excel or Google Sheets

The download is a UTF-8 text file named data.csv with lines separated by a line feed. There is no byte order mark, so Excel may show accented or non-Latin characters as garbled text when the file is opened by double-click. Importing it through Data, From Text/CSV and choosing UTF-8 as the file origin avoids that, and the same dialog lets you mark columns as text.

Marking columns as text matters more often than people expect. A spreadsheet guesses types on open: 007 becomes 7, a long card or order number is shown in exponent form, and a code such as MAR1 can be turned into a date. None of that is in the file; it happens on import.

A cell that starts with an equals sign, such as =SUM(A1:A2), is written exactly as it appears in the JSON and a spreadsheet will treat it as a formula. If the JSON comes from users or another untrusted source, check for such values before opening the export.

What this converter does not do

  • Flatten nested objects into dotted columns such as address.city. Nested values stay in one cell as JSON text.
  • Expand an array inside a record into several rows.
  • Find the list inside a wrapper object. You paste the array itself.
  • Read a .json file from disk. Input is pasted text.
  • Quote every field or change the quote character. Only values that need quoting are quoted, always with double quotes.
  • Reorder, rename or drop columns. Column order follows the order keys first appear.

Using JSON to CSV Converter

  1. 1

    Paste your data into JSON array. It must be valid JSON: double-quoted keys, no trailing commas, no comments.

  2. 2

    Choose a Delimiter: Comma for most imports, Semicolon for Excel in regions that use a decimal comma, Tab for pasting straight into a spreadsheet, or Pipe.

  3. 3

    Leave Include header row ticked to write the key names as the first line, or untick it when appending to a file that already has headers.

  4. 4

    Check Rows and Columns in the Summary against what you expect, then copy the CSV or download it as data.csv.

Common questions

Is my JSON uploaded to a server?
No. Parsing and conversion run as JavaScript in your browser, so the data you paste is not sent anywhere. That makes it suitable for API exports containing customer records.
Does the output follow RFC 4180?
It follows the quoting rules: a field containing the delimiter, a double quote or a line feed is wrapped in double quotes, and a double quote inside it is doubled. It differs in two details: lines end with a line feed, not a carriage return plus line feed, and header names are written without quoting.
In what order do the columns appear?
In the order keys are first encountered while reading the array from top to bottom. [{"b":1,"a":2},{"a":3,"c":4,"b":5}] gives the columns b,a,c. To control the order, make sure the first object lists every key in the order you want.
How do I convert JSON from an API response that wraps the list in an object?
Copy only the array. If the response is {"data":[...],"total":40}, paste the part from the opening square bracket after "data": to its matching closing bracket. Pasting the whole response gives a single row with the list squeezed into one cell.
Are dates converted?
No. JSON has no date type, so a value such as "2026-10-08T09:30:00Z" is a string and is written unchanged. A spreadsheet may recognise it as a date when the file is opened.
Is there a limit on the size of the array?
No fixed limit is set. The work is done in the page, so the practical limit is your browser's memory, and a paste of many megabytes can make the tab slow. For very large exports a command-line tool such as jq is a better fit.
How do I go the other way, from CSV back to JSON?
Use the CSV to JSON Converter on this site. It reads the header row as keys and returns an array of objects, the same shape this page accepts.

Looking for something else? Browse all developer tools or see every tool.