toolqik

110 · JSON

JSON to CSV

Flatten a JSON array into a CSV file for Excel or Sheets.

Runs in your browser
Options
CSV

  

About this tool

JSON is how APIs return data; CSV is how people open it in Excel, Google Sheets or a BI tool. This JSON to CSV converter turns an array of objects into rows and columns, flattens nested objects into dotted column names, and finds the data array inside a typical API response for you. It runs in your browser, so exported customer or order data never leaves your machine.

How to use it

  1. Paste JSON, drop a .json file, or click Open file. JSON Lines (one object per line) works too.
  2. Choose the delimiter and options, then check the result in Table preview.
  3. Copy the CSV or download it as data.csv. Turn on Excel-friendly download if the file will be opened in Excel.

How JSON becomes rows and columns

  • An array of objects becomes one row per object. Columns are every key that appears in any object, in the order first seen; missing values are left empty.
  • An API response such as {"data": [ … ], "page": 1} is unwrapped: the converter uses the first property that holds an array of objects and tells you which one.
  • Nested objects are flattened: {"address": {"city": "Pune"}} becomes a column called address.city. Turn flattening off to keep the object as JSON text in one cell.
  • Arrays inside objects, such as "tags": ["a", "b"], are written as JSON text in a single cell, because they can’t become columns without guessing.
  • An array of arrays is written as rows exactly as given, and null becomes an empty cell.

This converter is the reverse of the CSV to JSON tool: with “Nest a.b columns” on there, dotted columns turn back into nested objects.

Opening the CSV in Excel

  • Accented or non-English characters look garbled? Excel assumes your system’s legacy encoding unless the file starts with a byte-order mark. Excel-friendly download adds one.
  • Everything lands in column A? Excel in many European locales expects semicolons. Choose Semicolon as the delimiter.
  • Long numbers turn into 1.23E+15 or lose their leading zeros? That is Excel’s display, not the file. Use Data → From Text/CSV and set those columns to Text.

CSV injection

Spreadsheet apps treat a cell that starts with =, +, - or @ as a formula. If your JSON contains text typed by users, such as names or comments, a value like =HYPERLINK(…) could run when someone opens the file. If you share exports of user-supplied data, turn on Block spreadsheet formulas: it puts a ' in front of such text cells (numbers are left alone), as recommended by OWASP.

Convert JSON to CSV in code

import json
import pandas as pd

with open("data.json", encoding="utf-8") as f:
    data = json.load(f)

# json_normalize flattens nested objects into "a.b" columns, like this tool
pd.json_normalize(data).to_csv("data.csv", index=False)

FAQ

How do I convert JSON to CSV?

Paste a JSON array of objects into the box above. Each object becomes a row and each key a column. Copy the CSV or download it as data.csv.

How are nested objects handled?

They are flattened into dotted column names, so {"user": {"name": "Ada"}} becomes a user.name column. Arrays are kept as JSON text in a single cell.

Can I open the result in Excel?

Yes. Turn on "Excel-friendly download" so accented characters display correctly, and use semicolons if your Excel uses a comma as the decimal separator.

What if my objects have different keys?

Every key from every object becomes a column, in the order first seen. Rows without a value for a column get an empty cell.

Does it work with JSON Lines?

Yes. If the input is not a single JSON document, each line is parsed as its own JSON value.

Is my JSON uploaded anywhere?

No. The conversion runs in a background worker in your browser, so nothing is sent to a server.

esc
↑↓ navigate↵ open