Free developer tool

JSON to CSV Converter

Paste a JSON array of objects to get CSV rows with a header, or paste CSV to get JSON. Quotes and commas inside values are handled correctly.

Report a problem or suggest a fix for this tool

What is json to csv converter?

JSON is the format of APIs, and CSV is the format of spreadsheets. Moving data between them is a daily task for analysts, marketers and developers.

This converter builds the header from all keys it finds, quotes values that contain commas or line breaks and turns nested values into JSON text. It also goes the other way, from CSV to a JSON array.

How to use the json to csv converter

  1. Pick the direction.
  2. Paste your data.
  3. Press Convert and copy the result, then save it as a .csv or .json file.

How the json to csv converter works

For JSON to CSV, the keys of every object are collected into a header row and each object becomes a row. Values with commas, quotes or line breaks are wrapped in double quotes with quotes doubled. For CSV to JSON, the first row becomes the keys and each later row becomes an object.

Worked example

Two objects with name, city and age become a header row and two data rows. A value like Leeds, UK is quoted so the comma does not split the column.

Common uses of the json to csv converter

  • Exporting API data to a spreadsheet.
  • Importing CSV data into an app that wants JSON.
  • Preparing sample data for tests.
  • Cleaning exports from tools.
  • Sharing data with people who prefer Excel.

Tips and common mistakes

Flat arrays of objects convert best. Deeply nested data may need flattening first.

CSV has no types, so numbers become text when you convert back to JSON.

Background: what to know before you rely on it

CSV looks simple but has quirks. The standard rules, written down in RFC 4180, say that fields with commas, quotes or line breaks must be wrapped in double quotes, and a quote inside a field is written as two quotes. Different tools use different separators, such as semicolons in many European locales, and different encodings, which causes broken accents when a file opens in a spreadsheet. JSON, by contrast, has types and nesting. Converting nested JSON to a flat table means choosing how to flatten it, for example by joining keys with dots. For large datasets, use a script or a data tool instead of a browser page.

Private, free and fast

This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.

Field by field guide

  • Direction: Choose one of: JSON to CSV; CSV to JSON.
  • Your data: Type or paste your text here. Use a new line for each entry where the label says so.

Change one field at a time to see how the result responds, and use the worked example above to check that you get the same answer.

Flattening JSON into rows

JSON is nested while CSV is flat. The converter uses keys as columns and each object as a row.

Expert tips

  • Make sure each object has the same keys, or missing ones will be blank.
  • Nested objects are best flattened with dotted names such as address.city.
  • Arrays inside records may need to be joined into one cell.
  • Open the CSV in a spreadsheet with UTF8 encoding.
  • Check that long numbers like IDs are not turned into scientific notation by the spreadsheet.

CSV loses structure, so keep the JSON if you need to restore the original shape.

Frequently asked questions

How do I convert JSON to CSV?

Paste a JSON array of objects and press Convert. The keys become the header.

What if objects have different keys?

The header includes every key. Missing values stay empty.

Does it handle commas and quotes?

Yes, it follows standard CSV quoting.

Is my data uploaded?

No.

Embed this tool on your website

Copy the code below and paste it into your page or blog post. The tool is free to embed, runs in the visitor's browser and needs no account. Please keep the credit link.

Related tools

Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.