JSON to CSV Converter

Convert JSON arrays to CSV instantly. Supports nested object flattening (dot-path), custom delimiters, and RFC 4180 escaping. Free, runs in your browser.

  • Runs in your browser
  • Your data never leaves your browser
  • Free · No Sign-Up
Delimiter Separate columns with a comma, semicolon or tab. Fields containing the chosen delimiter, quotes or line breaks are quoted automatically.
More CSV options
Flatten nested objects On expands non-empty nested objects to dot-path columns. Off keeps each nested object as JSON text. Arrays and empty objects stay in one column.
Include header Include the union of keys from every row as the first line. Missing values become empty fields.
Formula guard Off leaves risky strings unchanged. Quote or Tab prefix protects matching strings and headers, then quotes the CSV field. Numeric values are unchanged.
UTF-8 BOM in download (Excel) Add a UTF-8 BOM to downloaded files for Excel. The displayed and copied CSV never includes this added BOM.
Replace the input with two user records containing nested addresses, then convert with the current options.
Clear JSON, CSV and status while keeping all five options. Ctrl/⌘+L in this tool also clears the result.
Enter a JSON array. Conversion runs 300 ms after typing stops; option changes apply immediately. Invalid JSON clears the output.
CSV Output
Save the complete CSV as export.csv using the current UTF-8 BOM setting. Empty output is not downloaded.
Copy the complete displayed CSV without an added BOM. Empty output is not copied.

Enter a JSON array or load the example to generate CSV.

Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.

Worked Examples

Basic conversion

Input JSON:

[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]

Output CSV:

id,name
1,Alice
2,Bob

Nested object flattening

Input JSON:

[{"user":{"name":"Alice","age":30}}]

Output CSV (flatten on):

user.name,user.age
Alice,30

Fields with commas

A field value containing a comma is automatically quoted:

name,description
Widget,"Small, round widget"

Arrays, missing keys and quotes

Input JSON with an array, a two-level nested object, a missing key and a value with quotes:

[{"id":1,"name":"Ann","tags":["a","b"],"address":{"city":"Paris","geo":{"lat":48.85}}},
{"id":2,"name":"Bo, Jr.","note":"says \"hi\""}]

Output CSV with flatten on:

id,name,tags,address.city,address.geo.lat,note
1,Ann,"[""a"",""b""]",Paris,48.85,
2,"Bo, Jr.",,,,"says ""hi"""

Flattening follows nested objects to any depth (address.geo.lat). Arrays are not split into columns: tags is written as the JSON text [“a”,“b”], quoted because it contains ”. The header is the union of the keys of all rows, in the order they first appear, so note comes last and row 1 leaves it empty. With flatten off, address becomes one column holding {"city":"Paris","geo":{"lat":48.85}}.

Semicolon delimiter for European Excel

Excel in locales that use a decimal comma (German, French and others) reads ; as the list separator. [{"sku":"A-1","price":9.5,"active":true},{"sku":"B-2","price":null}] with the semicolon delimiter gives sku;price;active, A-1;9.5;true and B-2;;. Numbers keep the JSON decimal point, true is written as text, and null becomes an empty field. The Tab delimiter gives TSV, which pastes straight into spreadsheet cells.

Quoting and Line Breaks

Quoting follows RFC 4180 §2: a field that contains the delimiter, a double quote, a line feed or a carriage return is enclosed in double quotes, and a literal double quote is written as "". Rows are separated by a line feed (LF), not the CR LF that the RFC describes; Excel, LibreOffice, pandas and Python’s csv module all read both.

Formula Guard

A cell that starts with =, +, - or @, a Tab or a line break can be run as a formula when the CSV is opened in a spreadsheet (OWASP: CSV Injection). The tool counts such string values and the status line reports them. With the guard on, each of them gets a prefix and is quoted, as the OWASP page recommends: ’ prefix adds ’, and Tab prefix (Excel) adds a Tab, which OWASP gives as the form Excel keeps after the file is saved and opened again. Input:

[{"name":"Ann","comment":"=HYPERLINK(\"http://example.com\",\"Click\")"}]

Output with the ’ prefix:

name,comment
Ann,"'=HYPERLINK(""http://example.com"",""Click"")"

Only JSON strings are changed. Numbers such as -5, booleans, and arrays or objects written as JSON text are left as they are. The guard also changes the data: a phone number such as +81 3 1234 5678 keeps the prefix, so the guard is off by default and the status line tells you when it would apply.

Excel and the Byte Order Mark

The downloaded file starts with the UTF-8 byte order mark (bytes EF BB BF) by default. Microsoft’s support page Opening CSV UTF-8 files correctly in Excel says a UTF-8 CSV opens normally when it was saved with a BOM; without one, Excel on Windows reads a double-clicked file in the system code page, and accented or CJK text appears garbled. Programs that do not expect a BOM can read it as part of the first header name: Python’s open(…, encoding=“utf-8”) gives \ufeffid, while encoding=“utf-8-sig” removes it. Turn the option off for those. Copy never adds a BOM.

Limits

  • The input must be a JSON array. A single object gives “Input must be a JSON array of objects”; wrap it in [ ]. Items that are not objects, such as [1,“two”,null], become a single value column.
  • Empty nested objects and arrays are not expanded: "meta":{} gives a meta column holding {}.
  • Integers above 253 lose precision when the JSON is parsed: 12345678901234567890 is written as 12345678901234567000. Store long IDs as strings in the JSON.
  • Rows are separated by LF. Excel, LibreOffice, pandas and Python’s csv module read it; tools that require CR LF need a conversion.

To turn CSV back into JSON, use the CSV to JSON Converter.

FAQ

What JSON format is accepted?

The tool accepts a JSON array of objects, e.g. [{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]. Each object becomes one CSV row.

How does nested object flattening work?

When 'Flatten nested objects' is on, a field like address.city becomes a separate CSV column named address.city. When off, the entire nested object is serialized as a JSON string in a single column.

What happens if objects have different keys?

The tool collects the union of all keys across every row and uses that as the header. Missing values for any row are output as empty strings.

How are special characters handled?

Fields containing the delimiter, double quotes, or newlines are automatically wrapped in double quotes per RFC 4180. A literal double-quote inside a field is escaped as two consecutive double-quotes.

Why does Excel show garbled characters?

Excel on Windows reads a double-clicked CSV as UTF-8 only when the file starts with a byte order mark. The download adds one by default; if you turned it off, open the file with Data → From Text/CSV and choose UTF-8.

Is my data sent to a server?

No. The CSV is built in your browser tab, and the JSON is not sent to a server or saved in browser storage. When you finish editing the input, change an option or load the example, the page's analytics records one usage event with the tool name and the action (convert), not the JSON or the CSV.