Convert JSON and CSV

Flatten an array of objects into a CSV table, or read a CSV into JSON objects, with quoting handled properly.

Convert JSON and CSV

0 characters

Three steps — nothing to install

  1. Paste the JSON or CSV

    An array of objects for the JSON direction, or a table for the CSV direction.

  2. Set the delimiter

    Comma, semicolon, tab or pipe, and whether the first row holds column names.

  3. Copy or download

    The counts of rows and columns are reported; the original stays in the box.

Columns come from the data

Converting JSON to CSV needs a rectangle, and JSON is not one. The columns are the union of every key in every object, in first-seen order. A row that lacks a key gets an empty cell rather than a shifted row, which is the failure mode of naive converters.

An array of arrays is not accepted, because there are no column names to write. Wrap the data as an array of objects, or use the spreadsheet converter if you have a table rather than records. A single object is treated as one row.

Quoting and delimiters

A cell is quoted when it contains the delimiter, a double quote, a line break, or leading or trailing spaces. Quotes inside the cell are doubled, which is the RFC 4180 rule and what spreadsheets expect. Without that, one address with a comma breaks every column after it.

Semicolon is the default delimiter in much of Europe, where the comma is the decimal separator; tab is what spreadsheet apps use when copying a selection; pipe is common in log exports. Pick the one the file actually uses. Guessing wrong produces one wide column instead of a table.

Nested data and numbers

A nested object or array is written as JSON text inside its cell rather than being flattened into invented column names. That keeps the value intact and makes the choice yours: if you want it flattened, do that first with the JSON formatter and a deliberate key scheme.

Numbers keep their JSON form. Very large integers may already have lost precision when the JSON was parsed, and a leading zero in a code is lost when it becomes a number — put identifiers in quotes. For an actual Excel workbook rather than CSV, use the CSV and Excel converter.

Frequently asked questions

Can it read nested JSON?It writes nested values as JSON text inside the cell instead of flattening them. Flatten first if you need separate columns.
What if rows have different keys?Every key becomes a column and missing values are left empty, so rows never shift.
Does the first CSV row have to be a header?No. The header option is on by default; turn it off and the rows become arrays instead of objects.
Which delimiters are supported?Comma, semicolon, tab and pipe, for both directions.
Is my data uploaded?No. Parsing and writing happen on the strings in this tab.
Can it handle a large export?Tens of thousands of rows work. The limit is the tab's memory and how long the redraw takes.