Skip to content

JSON to CSV converter, nested JSON and JSON Lines too

JSON records as a CSV, in your browser. Nothing is uploaded.

Open a JSON file to convert it to CSV

Drop it here or choose a file. See it as a table, then download it as a CSV.

The sample: 72 made-up hourly weather readings from three UK cities, with nested fields.

Tip: drop several files to compare them.

Your file never leaves your device. It is read and charted by your browser. Nothing is uploaded.

Opens on the table, a row per record

View
The table, every record; the chart is one click away (Split or Chart).
Columns
Every key of any record, in the order the keys first appear; nested objects as path.to.field.
Download
“Download as CSV” over the table: every column and every record.
Digits
15 significant digits; “Full precision (17 digits)” under “Do more” writes every digit.

At a glance

Opens
JSON files (.json) and JSON Lines (.jsonl, .ndjson: one record per line).
Records
An array of objects, each a row; every key of any record is a column, in the order the keys first appear.
Nested objects
Flattened into columns named by their path: reading.wind.speed.
Arrays in a record
Kept whole as JSON text in one cell: ["ice"].
Missing and null
A record without a key, or with null, has an empty cell.
Values
Numbers with 15 significant digits, true and false as TRUE and FALSE, ISO times such as 2025-01-15T09:00:00Z as 2025-01-15 09:00:00.
Other shapes
Records inside an object ({"data": [...]}), pandas’ split format, an object of equal-length arrays, arrays of rows and arrays of plain values.
Size
A top-level array or JSON Lines has no fixed limit; the practical limit is your device. A file with an object at the top is read up to 268 MB.
Processing
Converted in your browser. Your file is never uploaded.
Price
Free. No account or sign-up.

How to convert JSON to CSV

  1. Open your JSON file. Choose a .json, .jsonl or .ndjson file, or drop it on the tool at the top of this page. No file to hand? Click “Try a sample JSON file”.
  2. Check the table. The records open as a table: one row per record, one column per field, nested fields named by their path. Scroll through it to check the columns.
  3. Download the CSV. Click “Download as CSV” over the table (or “Download all columns (CSV)” under “Do more”). The CSV holds every record and every column.

Which JSON becomes a table

Most JSON that holds data is a list of records, but not all of it is. These shapes open as a table:

ShapeExampleBecomes
An array of records[{"city": "Leeds", "temp": 4.2}, …]A row per record, a column per key.
JSON Lines{"city": "Leeds", "temp": 4.2} (one per line)The same: a row per line. Lines that are not JSON are skipped and counted.
Records inside an object{"data": [{…}, {…}]}The records of the array; a note names where they were found.
pandas’ split format{"columns": ["city", "temp"], "data": [["Leeds", 4.2], …]}The columns named, a row per inner array.
An object of arrays{"time": [0, 1, 2], "temp": [4.2, 4.0, 3.9]}A column per key, when the arrays have the same length.
An array of rows[["city", "temp"], ["Leeds", 4.2], …]A row per inner array; a first row of names only is the header.
An array of values[4.2, 4.0, 3.9]One column, “value”.

When an object holds several arrays of records, the one with the most records-like items is read and the note names the others it left out. Anything else, such as a single object with no array in it, opens as a table of one row.

Nested objects, arrays and missing fields

  • Nested objects are flattened into columns named by their path, with dots between the names:{"reading": {"wind": {"speed": 8.7}}} gives the column reading.wind.speed.
  • Arrays inside a record stay whole, as JSON text in one cell: ["ice"], written to the CSV as "[""ice""]" (a CSV doubles the quotes inside a quoted field). They are not spread over extra rows or numbered columns, so every record stays exactly one row.
  • Missing fields and null give an empty cell. The columns are every key of any record, in the order they first appear, so a field that only some records have still gets its column.
  • Values: numbers with 15 significant digits, true and false as TRUE and FALSE, text as it is, and ISO times such as 2025-01-15T09:00:00Z as 2025-01-15 09:00:00 (UTC, as in the file).

A worked example you can check

“Try a sample JSON file” opens 72 made-up hourly readings from Leeds, Cardiff and Belfast on 15 January 2025. Each record nests the station and the reading, has an alerts array, and only rainy hours have a rainfall. The first record:

{"time": "2025-01-15T00:00:00Z", "station": {"city": "Leeds", "code": "LDS"}, "reading": {"temperature": 2.0, "humidity": 88, "wind": {"speed": 8.7, "direction": "NE"}, "rainfall": 0.8}, "raining": true, "alerts": []}

Click Download as CSV, and the CSV, with its 10 columns, starts like this:

time,station.city,station.code,reading.temperature,reading.humidity,reading.wind.speed,reading.wind.direction,reading.rainfall,raining,alerts
2025-01-15 00:00:00,Leeds,LDS,2,88,8.7,NE,0.8,TRUE,[]
2025-01-15 00:00:00,Cardiff,CDF,4.3,94,8.2,W,,FALSE,[]

The Leeds record an hour later, with an ice alert and no rainfall, becomes:

2025-01-15 01:00:00,Leeds,LDS,0.6,89,13.9,S,,FALSE,"[""ice""]"

One reading has a null temperature and three have no wind direction: their cells are empty. A test opens the sample on every change to the site and compares its CSV with the file we expect, byte for byte, and does the same with the records written as JSON Lines. Download the sample file (JSON, 15 KB).

The same in Python

pandas’ json_normalize flattens nested objects the same way. On the sample file:

import json, pandas as pd

records = json.load(open("megarows-sample-uk-weather-readings.json"))
table = pd.json_normalize(records)
print(len(table), "rows,", len(table.columns), "columns")
print(table.to_csv(index=False).splitlines()[4])

It prints:

72 rows, 10 columns
2025-01-15T01:00:00Z,False,['ice'],Leeds,LDS,0.6,89,13.9,S,

The same 72 rows and 10 columns, in another order. pandas keeps the time as the text of the file and writes arrays the Python way (['ice']), where the CSV from this page has JSON (["ice"]), which other programs can read back. We ran it on 9 October 2026 with numpy 2.1.3, pandas 2.2.3, Python 3.12.15.

Private by design: nothing is uploaded

API exports and logs can hold customer or test data. This tool reads your file and writes the CSV in your browser, so the file and its name never leave your device. Big exports open too: JSON Lines and arrays of records have no fixed size limit, and the practical one is your device’s memory.

Next steps with your data

Frequently asked questions

How do I convert JSON to CSV?

Open the JSON file in the tool at the top of this page: it opens as a table. Click “Download as CSV” over it. Your browser reads the file on your own device and saves the CSV, with one row per record and one column per field.

What happens to nested JSON?

Nested objects are flattened into columns named by their path: {"reading": {"wind": {"speed": 8.7}}} gives a column reading.wind.speed. Arrays inside a record are not spread over rows or columns: each stays whole, as JSON text, in one cell, such as ["ice"].

Does it read JSON Lines (NDJSON)?

Yes: .jsonl and .ndjson files, one record per line, give the same table as the same records in one array. A line that is not valid JSON is skipped, and a note says which lines were.

What if my records have different fields?

Every key that appears in any record becomes a column, in the order the keys first appear. A record without a key, or with null, gets an empty cell in that column.

How big can the file be?

A file that is one array of records, or JSON Lines, has no fixed limit: it is read record by record, and the practical limit is your device’s memory. A file whose top level is an object has to be read whole, up to 268 MB; for bigger files, write the records as an array or as JSON Lines.

Is my file uploaded?

No. The file is read and the CSV is made by your browser, on your own device. Neither the file nor its name is sent anywhere; you can check it in the Network tab of your browser’s developer tools.

Coming soon to MegaRows: CSV to Excel and PDF reports · Compare CSV versions.

MegaRows processes files locally in your browser. Nothing is uploaded, not even the file name.