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
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 value | CSV 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 |
| 42 | 42 |
| true | true |
| null | (empty cell) |
| {"city":"NYC"} | "{""city"":""NYC""}" |
| ["a","b"] | "[""a"",""b""]" |
Output of this converter for each value type.
- Paste your JSON array of objects into the JSON panel.
- The tool automatically builds column headers from your JSON keys and generates the CSV output as you type.
- Check the CSV panel - values with commas, quotes, or line breaks are quoted, and nested values appear as JSON text.
- To go the other way, paste CSV into the CSV panel and the JSON panel updates with an array of objects.
- 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
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 ToolsJSON Formatter and Validator
Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.
Developer ToolsCSV to Excel Converter
Convert CSV files to downloadable .xlsx Excel spreadsheets instantly in your browser. No upload to any server required.
File ConvertersExcel to CSV Converter
Parse .xlsx and .xls Excel spreadsheets to CSV format with sheet selection. All processing happens in your browser.
File Converters