array in · table out

JSON array to CSV — one array, one table

Most APIs answer with a JSON array. This turns it into a flat table — plus the jq and Python one-liners if you would rather do it in a terminal.

Converter — Ready
Awaiting input
idle — paste an array and the rows show up here
0 rows 0 columns Tab delimiter
runs entirely in your browser
nothing is uploaded, ever
no sign-up, no account
free — no paid tier, ever
Do it in code

The jq and Python one-liners

Two short versions of the same job. jq is the fastest when it is already on your machine, and Python is the one that always works.

# Every object in the array becomes one CSV row.
jq -r '.[] | [.order_id, .customer, .total] | @csv' orders.json > orders.csv

jq - pick the fields you want, straight into a CSV file

import csv
import json

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

# Accept both a bare array and a single object.
rows = items if isinstance(items, list) else [items]

fieldnames = list(dict.fromkeys(k for row in rows for k in row))

with open("orders.csv", "w", newline="", encoding="utf-8") as f:
    writer = csv.DictWriter(f, fieldnames=fieldnames, restval="")
    writer.writeheader()
    writer.writerows(rows)

Python - the standard library version

The @csv filter in jq is the part people miss: it quotes and escapes each field for you, so a name containing a comma does not split the row in two. In Python, csv.DictWriter does the same job.

Neither snippet cares what the array elements look like as long as they are objects with the same keys. When the keys differ from row to row, the nested objects tool keeps every value instead of dropping the extras.

Worked example

A worked example

A three-element array of objects, and the three-row table it becomes.

orders.json

[
  {"order_id": 1001, "customer": "Ada Lovelace", "total": 42.5},
  {"order_id": 1002, "customer": "Grace Hopper", "total": 17},
  {"order_id": 1003, "customer": "Alan Turing", "total": 99.99}
]

orders.csv

order_id,customer,total
1001,Ada Lovelace,42.5
1002,Grace Hopper,17
1003,Alan Turing,99.99

Three elements, three rows, and the header taken from the keys. The converter above defaults to a tab delimiter so the file pastes straight into Excel - switch it to comma in the settings to match this example. The array order is preserved, which matters when the array is already sorted the way you want the sheet.

Step by step

Convert the array in the browser

The converter above takes exactly this input and gives you the same table.

  1. Paste the array

    The whole document, starting with the opening square bracket. If you paste a single object instead, the converter wraps it for you.

  2. Check the preview

    The row and column counts appear under the table so you can see at a glance that nothing was lost.

  3. Change the delimiter if needed

    Tab is the default for pasting into Excel. Pick comma for a standard .csv that other programs expect.

  4. Download

    One click writes the file with a .csv extension and the right encoding.

Why HopConvert

Built for real API responses

The shapes that actually come back from an API, handled properly.

One row per element

The array order is kept, so a paginated API response keeps its ordering in the sheet.

Union of keys

When later objects carry extra fields, they are kept as additional columns instead of being dropped.

Live preview

The table updates on every keystroke, so you can see the result before you download anything.

Stays on your machine

Parsing happens in the browser tab. Your payload is never posted to a server.

The complete guide

The full JSON to CSV guide

Everything about turning API payloads into flat tables - flattening rules, delimiters, quoting and encoding.

Read the JSON to CSV guide

Related tools: CSV to JSON converter · JSONL to CSV · JSON to CSV in Python · JSON to Excel

FAQ

Frequently asked questions

The short version of everything people ask about JSON arrays.

What does a JSON array look like?
A JSON array starts and ends with square brackets and holds values separated by commas: [{"id": 1}, {"id": 2}]. An array of objects - a list of records - is the shape almost every REST API returns for a collection.
How do I convert a JSON array of objects to CSV?
Read the array, then write one row per element with the keys of the first object as the header. In jq that is jq -r ".[] | @csv", in Python it is csv.DictWriter, and in the browser it is the converter above.
How many rows will my CSV have?
One row per array element, plus one header row. An array of 1,000 objects gives you 1,000 data rows. The preview under the converter shows the exact count before you download.
What if my JSON is one object, not an array?
It still works. The converter treats a single object as an array of one, and the Python snippet does the same with the isinstance(rows, dict) check. You get a header row and one data row.
What if the objects have different keys?
The header is built from every key that appears anywhere in the array, and rows that are missing a key get an empty cell for it. Nothing is dropped - which is the usual failure mode of a converter that only reads the first object.

Turn your array into a table

Free, instant, and private — your JSON never leaves this tab.

Convert the array Read the FAQ