DEV Community

Shaishav Patel
Shaishav Patel

Posted on

Export JSON to CSV File Free — API Responses, Nested Objects, and Bulk Download Without Code

You hit an API, get back a chunk of JSON, and now someone wants it "in a spreadsheet." You could write a quick script with a CSV library, fight the nested objects, and handle the edge cases — or you could export JSON to CSV in your browser in about ten seconds and get back to the actual work. This is about the second option, and the two things that make it harder than it looks: nested objects and arrays.

Why JSON to CSV isn't just a one-liner

CSV is flat — rows and columns. JSON usually isn't. The moment your data has nested objects or arrays, a naive conversion either drops them, dumps [object Object] into a cell, or crashes. The three cases that trip people up:

  • Arrays of flat objects — the easy case. [{ "name": "A", "age": 30 }, ...] maps cleanly to rows and columns.
  • Nested objects{ "user": { "name": "A", "city": "X" } } needs flattening into dotted columns like user.name, user.city, or it's lost.
  • Arrays inside records{ "tags": ["a", "b"] } has no obvious single-cell representation; it has to be joined or expanded, and a good converter makes that choice sensibly.

A converter that only handles the first case is the reason so many "json to csv" results come out half-empty.

The fastest way: convert and download in the browser

For a one-off export — or honestly, most exports — a browser tool beats writing code. No dependency to install, no script to babysit, and the data never leaves your machine.

The free JSON to CSV converter is built for the messy real-world cases, not just the textbook one:

  • Paste an API response directly — an array of objects becomes rows and columns instantly
  • Nested objects are flattened into readable dotted column headers, so nothing silently disappears
  • Download the CSV file with one click — ready to open in Excel, Google Sheets, or Numbers
  • Runs entirely in your browser — nothing is uploaded, which matters when the JSON is a production API response with real customer data

You paste, you check the preview, you download. That's the whole loop.

When you should still write code instead

Honest about the tradeoff: a browser tool is the right call for one-off and ad-hoc exports. Reach for a script when:

  • The conversion needs to run on a schedule or in a pipeline (a nightly export, a build step).
  • The JSON is enormous — hundreds of MB will choke any browser tab; stream it server-side instead.
  • You need custom transformation logic — renaming fields, filtering rows, computing new columns — beyond a straight flatten.

For everything else — the "can you put this in a sheet by 3pm" request — a browser converter is faster than the time it takes to npm install a CSV library.

A quick tip for cleaner output

Before you convert, paste the JSON into a validator first. A single trailing comma or unquoted key will make any converter fail with an unhelpful error, and it's much easier to spot the problem in a formatter that points to the exact line. Validate, then convert — it turns "why isn't this working" into a ten-second fix.

One honest caveat

Flattening is lossy by nature: a deeply nested structure squeezed into flat columns can become wide and a little awkward, and arrays-of-objects don't have a single "correct" CSV shape. For reporting and spreadsheet hand-off this is exactly what you want; if you need to perfectly round-trip the data back into the same nested JSON later, keep the original JSON too. CSV is the export format, not the source of truth.

Related Tools

Stop writing a throwaway script for a one-off export. Convert JSON to CSV free → — paste an API response, flatten nested objects, download the CSV, nothing uploaded.

Top comments (0)