JSON Array to CSV Converter Online
Convert JSON arrays to CSV โ nested flattening ยท custom delimiter ยท live preview ยท Excel download ยท 100% Free
JSON arrays of objects are the most common data structure from REST APIs โ and the most natural fit for CSV conversion. Each object in the array becomes a CSV row, and the object keys become CSV column headers. This converter handles the most common patterns: consistent keys, missing fields (filled with empty), extra keys in some objects and nested values requiring flattening.
What is JSON to CSV Conversion?
JSON to CSV conversion transforms JavaScript Object Notation (JSON) data into Comma Separated Values (CSV) โ a flat, plain-text format that can be opened in Microsoft Excel, Google Sheets, LibreOffice Calc, or imported into any database. CalcNation's JSON to CSV converter handles nested objects, arrays, inconsistent keys, and custom delimiters โ all 100% in your browser.
Options Explained
Flatten Nested JSON โ Converts nested objects to dot-notation columns. E.g. { "address": { "city": "X" } } becomes the column address.city. Flatten Arrays โ Expands array items to separate columns: tags[0], tags[1]โฆ Delimiter โ Choose comma (standard), semicolon (European Excel), tab (TSV for Excel paste), pipe, or a custom character. Header Row โ Toggle whether the first CSV row contains column names.
Frequently Asked Questions
What happens if JSON array objects have different keys?
This converter uses a union of all keys as CSV headers. Missing fields are filled with empty string. Example: Object 1 has {a,b}, Object 2 has {b,c} โ headers: a,b,c. Object 1 row: value_a, value_b, (empty). Object 2 row: (empty), value_b, value_c. This handles real-world APIs where optional fields are omitted from some records.
What is the maximum JSON array size for CSV conversion?
Browser-based conversion handles arrays up to ~100,000 rows comfortably (depends on object complexity). For larger datasets: use command-line tools: Node.js json2csv package (streams data for infinite size), Python pandas: pd.DataFrame(json_data).to_csv("output.csv"), jq: jq -r ".[0] | keys_unsorted[] as $k | $k" input.json to get headers.
Can I select which JSON array fields to include in CSV?
Yes โ after loading JSON, this tool shows a column selector where you can check/uncheck which fields to include. Useful when API returns 50 fields but you only need 8 for analysis. You can also reorder columns and rename headers before downloading. This saves time in Excel post-processing.
How do I convert a nested array in JSON to CSV rows?
If JSON has {"orders":[{"id":1,"items":[...]},...]}, you have a choice: (1) Tabulate orders (one row per order, items as flattened/joined). (2) Tabulate items (one row per item, with order data repeated). The right choice depends on your analysis need. This tool supports both approaches via the root path selector.