The most complete JSON to CSV converter online. Handles nested objects with dot-notation flattening, custom delimiters, column selection, live table preview, schema discovery, and Excel BOM — all in your browser.
No installation, no signup. Results in under a second for any file size.
.json file, or target a specific nested array using the JSONPath field — for example data.users for wrapped API responses..csv or copy to clipboard. Open directly in Excel, Google Sheets, Power BI, or import into any database.Nested objects are the #1 challenge in JSON to CSV conversion. Choose the mode that matches your target system.
JSON and CSV represent fundamentally different data models. JSON is hierarchical — it supports nested objects, arrays, and mixed types natively. CSV is tabular — flat rows and columns with uniform types per column.
Converting JSON to CSV makes sense when your downstream tool expects flat data: Excel, Google Sheets, Tableau, Power BI, SQL imports, and pandas DataFrames. It does not make sense when your JSON has deeply recursive structures that don't map to a natural table shape — in those cases, keep it as JSON and query it with tools like jq or DuckDB.
The hardest part of JSON to CSV is handling nested objects. A naive converter simply errors or ignores them. Our tool offers three strategies:
address.city into its own column. Most compatiblescores[0], scores[1] into separate columnsReal-world API responses often have inconsistent schemas — some objects have fields others don't. The converter collects all keys across all rows as the column set, then fills missing values with empty strings. The schema panel flags columns with mixed types in amber so you can investigate before exporting.
import pandas as pd import json # Flat JSON array data = json.load(open("data.json")) pd.DataFrame(data).to_csv("out.csv", index=False) # Nested JSON — flatten with json_normalize df = pd.json_normalize(data, sep=".") df.to_csv("out.csv", index=False, encoding="utf-8-sig") # utf-8-sig adds Excel BOM automatically # Target a nested array (e.g. response["data"]["users"]) wrapped = json.load(open("api.json")) df = pd.json_normalize(wrapped["data"]["users"]) df.to_csv("users.csv", index=False)
const fs = require("fs"); const data = JSON.parse(fs.readFileSync("data.json")); // Collect all headers across all rows const headers = [...new Set(data.flatMap(r => Object.keys(r)))]; // Build CSV rows with proper RFC 4180 quoting function quote(v) { const s = v == null ? "" : String(v); return s.includes(",") || s.includes(" ") || s.includes('"') ? `"${s.replace(/"/g, '""')}"` : s; } const rows = [ headers.join(","), ...data.map(r => headers.map(h => quote(r[h])).join(",")) ]; fs.writeFileSync("out.csv", "" + rows.join(" "));
function jsonToCsv(data, delim = ",") { const headers = [...new Set(data.flatMap(r => Object.keys(r)))]; const q = v => { const s = v == null ? "" : String(v); return s.includes(delim) || s.includes(" ") || s.includes('"') ? `"${s.replace(/"/g, '""')}"` : s; }; const rows = [ headers.join(delim), ...data.map(r => headers.map(h => q(r[h])).join(delim)) ]; return "" + rows.join(" "); } // Download helper const csv = jsonToCsv(myData); const a = document.createElement("a"); a.href = URL.createObjectURL(new Blob([csv], {type:"text/csv"})); a.download = "output.csv"; a.click();
$data = json_decode(file_get_contents("data.json"), true); $headers = []; foreach ($data as $row) { $headers = array_unique(array_merge($headers, array_keys($row))); } $f = fopen("output.csv", "w"); // Add UTF-8 BOM for Excel fputs($f, ""); fputcsv($f, $headers); foreach ($data as $row) { $csv_row = []; foreach ($headers as $h) { $v = $row[$h] ?? ""; $csv_row[] = is_array($v) ? json_encode($v) : (string)$v; } fputcsv($f, $csv_row); } fclose($f);
import ( "encoding/csv"; "encoding/json"; "os" ) var data []map[string]interface{} json.Unmarshal(jsonBytes, &data) // Collect all headers seen := map[string]bool{} var headers []string for _, row := range data { for k := range row { if !seen[k] { seen[k] = true; headers = append(headers, k) } } } f, _ := os.Create("out.csv") f.WriteString("") // UTF-8 BOM w := csv.NewWriter(f) w.Write(headers) for _, row := range data { var vals []string for _, h := range headers { if v, ok := row[h]; ok { vals = append(vals, fmt.Sprint(v)) } else { vals = append(vals, "") } } w.Write(vals) } w.Flush()
Any workflow where JSON data needs to reach a spreadsheet, database, or BI tool.
pd.json_normalize() for the same flattening our tool does automatically.Everything developers ask about converting JSON to CSV.
All free, all browser-based, no signup required.