Analytics teams live in spreadsheets, APIs emit arrays of objects, and getting from the second to the first is a weekly chore: open the JSON, squint at inconsistent keys, flatten something by hand, and hope the quoting survives the trip into Excel. This converter automates exactly that move. Paste an array of JSON objects, get CSV with every column properly quoted and every key from every row collected into the header — even when the rows disagree about which fields they carry.
That last part is the feature most converters skip. Real API data is ragged: a signup export where early rows lack plan, later rows lack referral_code, and one row carries a coupon nobody else has. A converter that derives columns from only the first row silently loses fields. This one scans every object and unions all keys across the whole array, so each field lands in its own column, and rows that lack a field simply leave that cell empty.
Everything runs locally in the browser — no upload, no account — which matters here more than usual, because the arrays people convert are exports of users, orders, and payments: exactly the data you should not be pasting into unknown servers.
How the Conversion Works
The pipeline is three steps. First, the input is parsed as JSON; if it fails, you get the syntax error with its line and column rather than a mangled file. Second, every key across every object is collected into one ordered set — this becomes the header row, preserving the order in which keys first appear. Third, each object is written as one CSV row, with a cell for every header column, empty where the object lacked the key.
A worked example with ragged keys. This three-object array:
[ { "email": "ana@example.com", "plan": "pro", "mrr": 49 }, { "email": "bo@example.com", "trial": true }, { "email": "cy@example.com", "plan": "free", "referral_code": "BOGO2026" } ]
produces this CSV structure: the header is email,plan,mrr,trial,referral_code — four keys beyond what the first row alone would have revealed. The first row reads ana@example.com,pro,49,, with empties for the fields Ana lacks; Bo's row carries trial as true and empties elsewhere; Cy's row fills referral_code. Three objects with three different key sets, one coherent table, zero dropped fields.
The Quoting Rules, Precisely
CSV quoting is where conversions quietly corrupt data, so the rules are applied strictly, following the standard Excel and RFC-4180 conventions:
- A cell containing a comma, a double quote, or a line break is wrapped in double quotes.
- A double quote inside a cell is escaped by doubling it: the value
He said "go"serializes as"He said ""go""". - A cell containing a line break stays one cell in Excel precisely because the quotes protect it — a review comment spanning two lines remains one review.
- Simple cells like
49orana@example.comare written bare, so the file stays readable and diffs cleanly.
The consequences are concrete. Export 200 support tickets whose comment fields contain commas, quotes, and multi-line text, and every ticket opens in Excel with its comment intact in the right cell — versus the naive converter's output where row 3's comment has leaked into columns G through K and every row below is shifted. Misaligned spreadsheets are not an inconvenience; they are wrong numbers in a report.
How to Use It (Step by Step)
- Paste your JSON array of objects into the input area. Nested objects in values are serialized compactly into their single cell rather than breaking the row.
- Check the generated header: it is the union of all keys, ordered by first appearance, which usually matches your mental model of the data.
- Use copy to grab the CSV text, or download it as a .csv file that Excel, Google Sheets, and Numbers all open directly.
- In the spreadsheet, verify the row count equals your array length and spot-check one tricky row — the one with the longest text field — for correct alignment.
- If the input is a single object rather than an array, it converts as a one-row table, which is handy for flattening a config into a reviewable sheet.
Spreadsheet-Ready: What That Actually Requires
Opening a CSV in Excel is easy; opening one correctly is not, and three properties separate a usable file from a corrupted one. Column alignment: every row must have exactly as many cells as the header, which the empty-cell rule guarantees. Quoting fidelity: commas and quotes inside values must be escaped, per the rules above, or the row structure collapses. Type survival: numbers written bare — 49, 12.5 — are recognized by Excel as numbers immediately, so sorting and formulas work without a text-to-columns rescue.
The recurring scenarios where this pays off: a PM exporting user signups from an internal admin API into a pivot table; a finance person pulling transaction objects into a reconciliation sheet; an engineer generating test fixtures as spreadsheets a non-technical teammate can edit and hand back. In each, the union-of-keys behavior is what makes the file complete, and strict quoting is what makes it survive Excel's parser.
JSON vs CSV: What Each Side Expects
The formats encode different assumptions, and knowing them prevents surprise. CSV is one flat table: a single record type, one header, no nesting. JSON objects nest freely, so a deeply nested input flattens awkwardly — a nested address object serializes as a compact JSON string inside one cell, which is faithful but not sortable. If you need city and zip as separate columns, flatten your JSON upstream so the keys exist at the top level. The table sums up the mapping:
| JSON input | CSV output | Note |
|---|---|---|
| Array of flat objects | Ideal table | The case this tool is built for |
| Ragged keys across rows | Union header, empty cells | Nothing dropped |
| Nested object value | Compact JSON string in one cell | Flatten upstream for real columns |
| Array value | Compact JSON string in one cell | Same rule |
Tips and Best Practices
- Flatten nesting before converting: map address.address1 to address1 in your script, and every downstream spreadsheet gets real columns.
- Keep keys clean — unique, lowercase, no spaces — so the header row is immediately usable in formulas and imports.
- Standardize nulls: use consistent empty strings or omit the key entirely, since either way the cell ends up empty but mixed conventions confuse analysis.
- Convert dates to ISO strings in the JSON first; Excel parses them reliably, while locale formats sometimes masquerade as text.
- For arrays of arrays or deeply mixed structures, extract the record list you actually need before pasting; one conversion should carry one record type.