Skip to main content

JSON to CSV

Convert JSON to CSV in your browser. Flattens nested objects into columns, handles ragged records, and never uploads your data.

All Data tools →

This tool runs entirely in your browser. Nothing you enter is sent to our servers, so there is nothing for us to store or see.

About the JSON to CSV

Paste JSON and get CSV back as you type. Everything runs inside this page on your own device, so an API response containing real customer data is never uploaded anywhere.

The hard part of this conversion is that JSON is a tree and a CSV is a rectangle, and most of the work is deciding how one becomes the other. An array of objects is the easy case. Real API output is usually not that: records disagree about which fields they have, values are themselves objects, and some are arrays. Records here are read in order and the columns are the union of every key that appears, in the order first seen — so a field present on only the last record still gets a column, and the records that lack it get an empty cell rather than being shifted sideways.

Nested objects can be flattened into dotted columns, so {"user":{"name":"Ada"}} becomes a column called user.name. Arrays are kept as compact JSON in a single cell instead, because a list whose length varies between records would otherwise add and remove columns from row to row. That keeps the output lossless and the column count stable, which are the two things that make a CSV usable afterwards.

Four input shapes are recognised: an array of objects, an array of arrays (used as the grid directly), an object whose values are all arrays (read as columns), and a single object (one row). Every value is quoted properly on the way out, so commas, quotation marks and line breaks inside a value survive intact.

How to use the JSON to CSV

  1. Paste your JSON

    Paste into the left pane, or drop a .json file onto it — dropping reads the file locally and never uploads it.

  2. Choose how to handle nesting

    Leave flattening on to turn nested objects into dotted columns. Turn it off to keep each nested value as compact JSON in one cell.

  3. Pick a delimiter

    A comma suits almost everything. Choose semicolon if the file is going to somebody on a European locale, and add a byte-order mark if it is going straight into Excel.

  4. Copy or download

    The CSV appears on the right as you type, with a row and column count underneath. Copy it or download it as a .csv file.

Frequently asked questions

Is my data uploaded anywhere?

No. The conversion runs inside your browser and nothing is sent to a server. You can disconnect from the internet after the page has loaded and it will keep working exactly as before, which is the simplest way to confirm it.

What happens when my records have different fields?

The columns become the union of every key that appears, in the order each was first seen. A field present on only one record still gets its own column, and every record that lacks it gets an empty cell — so nothing is dropped and no row is shifted sideways into the wrong columns.

How are nested objects handled?

With flattening on, they become dotted column names, so {"user":{"name":"Ada"}} produces a column called user.name. With it off, the whole nested value is written as compact JSON in a single cell, which is lossless but less convenient to read in a spreadsheet.

Why are my arrays not split into columns?

Because their length usually varies between records, and splitting them would add and remove columns from row to row — which produces a file where a given column means different things on different rows. Arrays are kept as compact JSON in one cell so the column count stays stable and nothing is lost.

Which JSON shapes does it accept?

An array of objects, an array of arrays (used as the grid directly), an object whose values are all arrays (read as columns, which is what plotting libraries produce), and a single object, which becomes one row. Anything else is reported rather than guessed at.

What if my JSON is invalid?

You get the parser's own message, which usually names the position of the problem, and no output. That is a normal part of editing rather than an error worth reporting — paste something incomplete and it will simply say so until the document is valid again.