Skip to content

JSON to CSV Converter

Convert a JSON array of objects to CSV with automatic column headers, and convert CSV back to JSON in the same tool.

JSON to CSV Converter tool

Loading...

Example

Input: [{"name":"Ada","age":36},{"name":"Alan","age":41}]

Result: name,age / Ada,36 / Alan,41

The object keys become the header row and each object becomes one CSV row. Values containing commas, quotes or line breaks are wrapped in double quotes.

How Values Are Written to CSV Cells

JSON valueCSV cell
"Ada"Ada
"Smith, Ada""Smith, Ada"
"say \"hi\"""say ""hi"""
" Ada" (leading space)" Ada"
"a\nb" (line break)Wrapped in quotes, line break kept inside
4242
truetrue
null(empty cell)
{"city":"NYC"}"{""city"":""NYC""}"
["a","b"]"[""a"",""b""]"

Output of this converter for each value type.

  1. Paste your JSON array of objects into the JSON panel.
  2. The tool automatically builds column headers from your JSON keys and generates the CSV output as you type.
  3. Check the CSV panel - values with commas, quotes, or line breaks are quoted, and nested values appear as JSON text.
  4. To go the other way, paste CSV into the CSV panel and the JSON panel updates with an array of objects.
  5. Click the copy button above the CSV panel to copy the result for your spreadsheet or database import.

How JSON Arrays Become CSV Rows

This converter turns a JSON array of objects into CSV. Each object becomes a row and each key becomes a column, so [{"name":"Ada","age":36}] gives a header line name,age followed by the row Ada,36. CSV (comma-separated values) is the plain-text table format that Excel, Google Sheets and most databases can import. It has no way to show nesting, so the converter makes a few choices for you. The header is built from every key found in any object, in the order they first appear. If a record lacks a key, that cell is left empty. Nested objects and arrays are written into a single cell as JSON text, such as ["a","b"].

Quoting follows RFC 4180, the common CSV standard. A value is wrapped in double quotes when it contains a comma, a double quote, a line break, or a space at the start or end. Quotes inside a value are doubled, so say "hi" becomes "say ""hi""". Null values become empty cells. The table below shows each case.

The input must be an array, and every item must be an object. A single object or a list of plain values shows an error. The tool also runs backwards: type CSV into the CSV panel and the JSON panel fills with an array of objects. That reverse direction splits on commas only. For semicolon or tab files, use the CSV to JSON Converter, which detects the delimiter. To get a real spreadsheet file, pass the result to CSV to Excel.

Sources

Frequently Asked Questions

That column held a nested object, and CSV cells are flat. Rather than drop the data, the converter writes the object into the cell as JSON text and quotes it so the file stays valid. If you need city as its own column, flatten the JSON first, for example by turning {"address":{"city":"NYC"}} into {"address_city":"NYC"}.
No. The output always uses commas, and any value that contains a comma is quoted so it imports correctly. If your spreadsheet expects semicolons, pick the comma delimiter in its import dialog, or use find and replace on the output. Be careful with that second option, because commas inside quoted values would be replaced too.
Every key that appears in any object gets a column, in the order it is first seen. Objects that lack a key get an empty cell in that column. So [{"a":1},{"b":2}] produces the header a,b with the rows 1, and ,2. Nothing is lost, but check for near-duplicate keys such as Name and name, which become two columns.
In regions where the decimal mark is a comma, Excel often expects semicolons and may put a comma CSV into a single column when you double-click it. Import it through Data, From Text/CSV and choose the comma delimiter instead. Excel also turns values like 01234 into the number 1234 on open. The CSV itself keeps the zero; set that column to Text while importing.

Related Tools

CSV to JSON Converter

Convert CSV data to a JSON array of objects with header mapping and automatic comma, semicolon, or tab detection.

Developer Tools

JSON Formatter and Validator

Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.

Developer Tools

CSV to Excel Converter

Convert CSV files to downloadable .xlsx Excel spreadsheets instantly in your browser. No upload to any server required.

File Converters

Excel to CSV Converter

Parse .xlsx and .xls Excel spreadsheets to CSV format with sheet selection. All processing happens in your browser.

File Converters

JSON to YAML Converter

Convert JSON documents to YAML format with syntax validation, clean formatting, and instant preview.

Developer Tools

JSON to XML Converter

Convert JSON data to well-formed XML documents with customizable root element and formatting options.

Developer Tools