JSON to CSV and CSV to JSON

Paste JSON to get a table you can open in Excel or Google Sheets, or paste CSV to get JSON for a program. Nested objects, arrays, quotes and separators are handled for you.

  • Free
  • No sign-up
  • Runs in your browser
json-to-csv

100% private — your text is processed in your browser and never sent to any server.

How it works

Paste your data

JSON, ideally an array of objects, or a CSV with a header row.

Choose the direction

JSON to CSV or CSV to JSON, with the separator and options you need.

Copy or download

Paste it into a spreadsheet, a script, a database import or an API test.

Two formats, one everyday conversion

JSON is what programs and web services exchange, and CSV is what spreadsheets and databases import. The two meet constantly: an API answer that someone wants to open in Excel, a spreadsheet that has to feed an application, an export that must be loaded into a database or a set of test data. This converter goes in either direction and takes care of the details that make hand conversion painful.

JSON to CSV

The best input is an array of objects, where each object becomes a row and each key a column. The column list is the union of every key found, in the order they first appear, so records with different fields still fit in a single table, and missing values are left empty. Nested objects are flattened using dots, so {"address": {"city": "Madrid"}} becomes a column named address.city. Arrays inside a record can be joined into one cell, kept as JSON text or spread over several columns, whichever your target needs. A single object becomes a one-row table, and an array of plain values becomes one column.

CSV to JSON

With a header row, each line becomes an object whose keys are the column titles; without one you get an array of arrays. The separator can be detected, so files from spreadsheets set to a comma, a semicolon or a tab are all read. Quoted fields are handled, including commas and line breaks inside quotes and doubled quotation marks. Optionally, text that looks like a number, true, false or null is turned into the matching JSON value, instead of leaving everything as text, and empty cells can be written as an empty string or as null.

Care with the details

Numbers are handled as text where possible, so a long identifier does not lose digits, and values with leading zeros, such as postcodes or phone numbers, are not converted into numbers, which would drop the zero. In CSV output, any value that contains the separator, a quotation mark or a line break is quoted correctly, following the standard convention.

What it does not do

CSV is flat and JSON is not, so a conversion from deeply nested JSON to CSV is a compromise. Rebuilding the original nesting from dotted column names is not attempted. Very large files are better handled by a script or a database import tool, since everything is processed in your browser's memory. To view or clean a CSV first, use the CSV viewer.

More developer and text tools

Frequently asked questions

How do I convert JSON to CSV?
Paste the JSON, keep "JSON to CSV" selected and copy the result, or download it and open it in a spreadsheet. An array of objects works best.
What happens to nested objects?
They are flattened with dots in the column names, for example address.city. Arrays can be joined into one cell, kept as JSON or spread over columns.
How do I convert CSV to JSON?
Choose "CSV to JSON" and paste your CSV. With a header row you get an array of objects; without it, an array of arrays.
Will numbers and codes with leading zeros stay right?
Values like 00123 are kept as text so the zeros are not lost, and long integers keep all their digits. Only clean numbers are converted to JSON numbers.
Does it handle commas and quotes inside values?
Yes. Values with the separator, quotes or line breaks are quoted correctly in the CSV, and quoted fields are read correctly when converting from CSV.
Is my data uploaded anywhere?
No. The conversion happens in your browser.