JSON to CSV
Convert JSON arrays of objects to CSV. Auto-detects fields, supports custom delimiters, escapes properly for Excel and Google Sheets.
Enter input above to see the result.
What is this for?
This tool converts JSON arrays of objects into properly formatted CSV files. It solves the common problem of needing to move structured data from JSON (APIs, exports, logs) into a spreadsheet application where colleagues, stakeholders, or downstream processes expect tabular data. Headers are auto-detected from your JSON object keys, and all values—including nested structures—are escaped correctly per RFC 4180 so Excel and Google Sheets read them without mangling.
When to use it
- Converting an API response into a CSV for import into a spreadsheet or BI tool.
- Exporting JSON records from a database dump or log file for analysis in Excel or Google Sheets.
- Preparing fixture data for CSV-based database imports, migrations, or data seeding.
- Sharing structured data with non-technical stakeholders who work exclusively in spreadsheet applications.
- Batch-converting JSON event logs or monitoring data into rows for pivot tables and filtering.
- Generating CSV input files for third-party SaaS tools that don't accept JSON natively.
How it works
- Parse input: Paste or upload a JSON array of objects. The tool validates the JSON syntax before proceeding.
- Extract headers: All unique object keys across every row become CSV column headers, in the order they're first encountered.
- Flatten rows: Each JSON object becomes one CSV row. Nested objects and arrays are JSON-stringified into single cells to preserve data integrity.
- Escape and format: All values are escaped according to RFC 4180: quotes are doubled, fields with special characters are wrapped in quotes, and carriage returns are preserved.
- Choose delimiter: Select comma (default), semicolon (for European locales), or tab before download.
Common gotchas
- Inconsistent object keys. The tool uses the union of all keys across your entire array. A row missing a key will have an empty cell in that column; columns never disappear.
- Nested structures become strings. Objects and arrays within your data are JSON-stringified as plain text in a single cell. If you need a fully flattened CSV (separate columns for nested properties), flatten your JSON manually before import.
- Delimiter and locale mismatch. European Excel installations expect semicolons as field separators, not commas. If your CSV opens as a single column, switch the delimiter setting and regenerate.
- UTF-8 encoding and Excel on macOS. Excel sometimes fails to decode UTF-8 without a byte-order mark (BOM). This tool outputs standard UTF-8 without BOM. If you see garbled characters, re-save the CSV with BOM enabled in your editor.
- Leading zeros and scientific notation. CSV lacks type information, so Excel may reformat numbers:
00123becomes123, and1.5e10may be auto-converted. Prefix numeric strings with a single quote in your JSON if exact formatting is critical.
Tips for best results
- Validate your JSON before pasting. This tool will reject malformed input.
- Pre-process nested data if flattening is required; use jq or a similar tool to reshape complex structures first.
- Test the output in your target application (Excel, Sheets) to catch encoding or delimiter surprises before sharing.
- If you need field selection or reordering, use this tool's output as a starting point and refine in a spreadsheet editor.