Skip to content
Your data never leaves your browser

JSON to CSV Converter

Structured data in, spreadsheet out. The circle of enterprise life.

Input
Output

What this does

DEVS: Columns are the union of keys across all objects, in first-seen order. Nested objects and arrays go into the cell via JSON.stringify, no dot-notation flattening. Papa.unparse with RFC 4180 quoting and CRLF line endings.

Paste a JSON array of objects, get CSV with one row per object. Every key that appears anywhere becomes a column, in the order the tool first meets it. An object missing a key gets an empty cell there.

A single object works too and gives you a one-row CSV. An array of arrays turns each inner array into a row, with 0, 1, 2 as the header. The longest row sets how many columns there are.

Three users with mismatched fields go in:

[
  { "id": 1, "name": "Ada", "tags": ["admin", "ops"] },
  { "id": 2, "name": "Grace", "address": { "city": "Arlington", "zip": "22201" }, "active": true },
  { "id": 3, "name": "Linus, Jr.", "active": null }
]

And come out as:

id,name,tags,address,active
1,Ada,"[""admin"",""ops""]",,
2,Grace,,"{""city"":""Arlington"",""zip"":""22201""}",true
3,"Linus, Jr.",,,

Five columns, because five different keys showed up. The tags array and the address object each landed in a single cell as JSON text.

Common use cases

Handing API data to someone who lives in Excel. You have the response. They want "the spreadsheet." This is the short way there.

Importing into things that only take CSV: Google Sheets, Airtable, a mail merge, or Postgres COPY ... WITH (FORMAT csv).

Spotting gaps. Thirty objects with slightly different keys are hard to compare as JSON. In a grid, the empty cells jump out.

Things to know

Nested data stays whole. An object or array goes into one cell as JSON, with its quotes doubled the way CSV requires. null and missing keys both become empty cells. true and false come out as the words true and false.

Cells that contain a comma, a double quote, a line break, or a leading or trailing space get wrapped in quotes. Lines end with CRLF, per RFC 4180. Values starting with = go through as written, and a spreadsheet will run them as formulas. Worth remembering if the data came from users.

Every item has to be an object. Mix in a string and the error names it: "Item 2 is not an object. JSON to CSV needs an array of objects." JSON Lines (one object per line, no brackets) won't parse either. Wrap the lines in [ ] and put commas between them.

Privacy

The conversion runs in your browser. Whatever's in that API response, tokens and all, stays in your tab. We never built a server to send it to.

Questions

How do I convert nested JSON to CSV?

Paste it as is. Nested objects and arrays stay whole, as JSON text inside one cell, so nothing gets lost. If you need address.city as its own column, flatten the data first with jq or a few lines of code, then paste the flat version here.

Why is my whole API response in one row?

Your array is probably wrapped, like {"results": [...], "count": 2}. A single object converts to a single row, so the entire results array lands in one cell. Paste just the array inside and you get one row per item.

Will the CSV open correctly in Excel?

Usually. The download is UTF-8 with no byte order mark, and some Excel setups assume an older encoding when you double-click the file. That's how é turns into é. If you see that, use Data > From Text/CSV and pick UTF-8 as the file origin.

Why did my long ID change?

JavaScript can't store whole numbers above 9,007,199,254,740,991 exactly, so they get rounded the moment the JSON is parsed. 12345678901234567890 comes out as 12345678901234567000. Keep big IDs as strings in your JSON and they pass through untouched.