What Is This Tool?
APIs and databases usually return data as JSON, but spreadsheets, Excel, Google Sheets and most data-import tools expect CSV. This tool bridges that gap: paste an array of JSON objects (like an API response), and it builds a CSV with one column per unique key and one row per object.
The conversion handles the details that break naive approaches: values containing commas or quotes are properly escaped, missing fields become empty cells instead of crashing the conversion, and nested objects or arrays inside a field are serialized as a JSON string in that cell rather than being silently dropped.
Why Use It?
- Automatic header detection — the column list is built from the union of keys across all objects, so inconsistent records don't break the output.
- Correct CSV escaping — values with commas, quotes or line breaks are quoted properly, so the file opens cleanly in Excel or Google Sheets.
- Handles nested data — an object or array inside a field is serialized to JSON text instead of causing an error.
- Copy to clipboard or download as a .csv file directly.
- 100% client-side — your data (API responses, exported records) never gets uploaded anywhere.
How to Use
- Paste a JSON array of objects, e.g. [{"name":"Alice","age":30},{"name":"Bob","age":25}].
- Click "Convert to CSV".
- Review the output — copy it or click "Download CSV" to save a file.
- Open the downloaded file in Excel, Google Sheets, or any spreadsheet tool.
Example
Input
[{"name":"Alice","age":30},{"name":"Bob","city":"NYC"}]Output
name,age,city
Alice,30,
Bob,,NYCNote how "city" and "age" both become columns even though no single object has both — missing values are just left blank.
Practical tips
- Converting an API response for a spreadsheet report: paste the JSON array directly from a browser's Network tab or an API testing tool, convert, and download — no intermediate script needed.
- Working with inconsistent records (e.g. optional fields from a form export): the automatic header detection means you don't need to manually reconcile schemas first.
- If your JSON is a single large object with an array nested inside (e.g. {"users": [...]}), extract just the array part (the [...] portion) before pasting it here.
Why column order and completeness matter
A subtle but common CSV bug happens when data is exported by hand-writing headers first and hoping every row matches: if row 50 out of 1000 has an extra field none of the earlier rows had, a naive line-by-line CSV writer either drops that field silently or shifts every subsequent column out of alignment. This tool avoids that failure mode by scanning every object in the array first to build the complete, correct header row before writing a single line of output — so a field that only appears once, on the very last object, still gets its own column and every other row's value for it correctly shows as blank rather than corrupting the row structure.
Frequently Asked Questions
Does this work with a single JSON object instead of an array?
It expects an array — wrap a single object in square brackets, e.g. change {"name":"Alice"} to [{"name":"Alice"}], and it will convert to a one-row CSV.
What happens to nested objects or arrays inside a field?
They're serialized as a JSON string within that cell (e.g. a field containing {"a":1} becomes the text "{""a"":1}" in the CSV, properly quote-escaped) rather than causing an error or being dropped. If you need nested data flattened into separate columns, that requires a different, schema-specific tool.
Is my data uploaded to a server?
No. The conversion runs as JavaScript entirely in your browser — nothing is sent anywhere, which makes this safe to use with exported customer or business data.
Why does my CSV have blank cells?
If some objects in your array are missing a key that others have, that column exists but the cell is left blank for objects that don't have it — this preserves all your data instead of erroring out on inconsistent records.
Will values with commas break the CSV?
No. Any value containing a comma, quote character, or line break is automatically wrapped in quotes (with internal quotes escaped) per standard CSV rules, so it opens correctly in Excel and Google Sheets.