Code and data

JSON to CSV converter

Paste JSON, JSON Lines, or a CSV, or open a file. JSON to CSV builds a header and one row per record. CSV to JSON builds an array of objects, with numbers and true or false read back when you leave that on.

Runs in your browser. Nothing you type or open is uploaded. Free to use, no account. More code and data tools

How to use it

  1. Paste the JSON or CSV, or open a file.
  2. Choose JSON to CSV or CSV to JSON, and the options under the box.
  3. Read the preview, then copy or download the result.

How nested JSON becomes columns

An array of objects is the table. If the JSON is wrapped, the page uses the largest list of objects it finds, including lists named data, results or items. Nested objects become columns such as address.city. Arrays of plain values are joined in one cell, or you can ask for one row or one column per item.

CSV to JSON treats the first row as the header. Dot paths such as address.city become nested objects when that option is on. Numbers, true, false and null are read as those types. A value with a leading zero, such as a postcode, stays text, and so does an integer too big for a safe JavaScript number.

Private by design

Privacy

Everything runs in this page and stays on your device. The text is kept in this tab, so a reload brings it back, and closing the tab clears it.

This page also shows Google ads, which can use cookies. Privacy and cookies explains how.

Questions

Can I convert JSON Lines?

Yes. When the file is one JSON value per line, each line becomes a row.

What happens to a list of tags?

By default the values share one cell, separated by a semicolon and a space. Choose one row per item or one column per item if you want them split.

Will a phone number lose its leading zero?

A number that starts with zero stays text, so 0123 is still 0123.

Which delimiter should I pick?

Leave Detect on. A file that uses semicolons or tabs is recognised. You can force comma, semicolon, tab or pipe.

How do I get the objects back?

Choose CSV to JSON and leave Turn dot paths back into objects on. address.city becomes an address object with a city field.

From the same developer