Paste some JSON to see the columns it turns into.
Need the reverse? CSV to JSON Converter

About the JSON to CSV Converter

What is a JSON to CSV converter?

JSON is how data travels between programs. CSV is how data gets into a spreadsheet. A JSON to CSV converter sits between the two, taking a list of records and laying them out as rows and columns so Excel, Google Sheets, Numbers or a database import can read them.

The awkward part is that JSON has shapes CSV does not. A record can hold another record inside it, or a list, or a list of records. Most converters either give up on that or quietly dump the whole thing into one cell as a blob of text. This one flattens the structure into real columns, tells you which columns it built, and lets you switch the strategy when the default is not what you want.

How to Use This Tool

  1. Paste your JSON. An array of records, a single record, a wrapped API response or NDJSON with one record per line all work. You can also drop a file onto the box or use Open file.
  2. Check the column map. The strip under the boxes lists every column the converter built, the kind of value in it, and whether some records were missing it.
  3. Adjust the nesting if you need to. Nested objects and lists can become separate columns, one joined cell, or JSON text held in a single cell.
  4. Match the CSV to wherever it is going. Semicolons and CRLF line endings for Excel in Europe, tabs for a TSV, a byte order mark if accented characters come out wrong.
  5. Copy or download the result. Nothing is uploaded, so the conversion runs on whatever you paste without a size cap or a sign-up.

Example

With the default options (dot flattening, one column per list item, comma delimiter, header row on), this JSON will be converted to a five column CSV:

Input: JSON
[
  { "id": 1, "name": "Ada Lovelace",
    "address": { "city": "London" },
    "tags": ["math", "code"] },
  { "id": 2, "name": "Grace Hopper",
    "address": { "city": "New York" },
    "tags": ["navy"] }
]
Output: CSV
id,name,address.city,tags.0,tags.1
1,Ada Lovelace,London,math,code
2,Grace Hopper,New York,navy,

The nested address object became address.city, the list became tags.0 and tags.1, and Grace has no second tag so that cell is left empty. Set Lists of values to Join into a single cell and the same input gives you one tags column holding math|code instead.

Converting nested JSON to CSV

Nesting is where converters disagree with each other, so it is worth knowing what this one does. A nested object turns into one column per leaf value, with the path as the column name. That is the same dot convention pandas.json_normalize, Elasticsearch and Splunk use, so anything downstream already knows how to read it.

JSONFlatten with dotsFlatten with bracketsKeep as JSON text
{"a":{"b":1}}a.ba.ba holds {"b":1}
{"t":["x","y"]}t.0, t.1t[0], t[1]t holds ["x","y"]
{"o":[{"s":"A"}]}o.0.so[0].so holds the whole list
{"t":[]}t, left emptyt, left emptyt holds []

Records do not have to agree with each other. The converter walks all of them and collects column names in the order they first show up, so a key that only appears in the last record still gets a column and every other row gets an empty cell there. Nothing is dropped because it was missing from the first record, which is the mistake that costs people whole fields on other tools.

Finding the rows inside an API response

Real API payloads rarely hand you a bare array. They wrap it in status fields and paging metadata, something like {"status":"ok","page":1,"data":[...]}. Leave Rows to convert empty and the converter searches for the first list of records and uses that, then says so in the notes panel along with the top level keys it left out. If it picks the wrong list, type the path yourself. Dots walk into objects and brackets pick an index, so data.users and results[0].rows both work.

Reading the column map

The strip between the boxes is the part other converters leave out. Every column gets a card showing its name, the type of value in it, and a count when the column is missing from some records. A card that reads mixed means one column holds more than one kind of value, which usually points at a field that changed shape partway through an export. Spotting that before the file lands in a database saves an import that would otherwise fail halfway.

NDJSON and JSON Lines

Logs, exports and streaming APIs often use NDJSON, where each line is its own JSON object and there are no commas or brackets holding them together. Paste that straight in. If the whole document does not parse as JSON, the converter tries it line by line, and when every line parses it treats them as your records. JSONL and NDJSON are the same format under two names, and both work here.

Making a CSV that Excel opens cleanly

Excel is picky in ways that have nothing to do with your data. Three settings fix almost every complaint:

  • Everything landed in column A: your copy of Excel expects semicolons. Switch Delimiter to Semicolon, which is what Excel wants in most of Europe where the comma is a decimal separator.
  • Accented characters look like mojibake: turn on Add a UTF-8 byte order mark. Those three bytes are how Excel decides the file is UTF-8 instead of guessing your system code page.
  • Rows run together on Windows: switch Line endings to CRLF. Google Sheets and Numbers are happy either way, so leave it on LF for those.

There is one more worth knowing about. A cell that starts with =, + or @ is treated as a formula by Excel and Sheets, which is how CSV injection works when the values came from somewhere you do not control. Neutralize spreadsheet formulas puts an apostrophe in front of those values so they stay text. Negative numbers are left alone.

Converting JSON to CSV in code

For a one-off file this page is faster. For a scheduled job, here is the short version in three languages. Python does the flattening for you if you use pandas:

Python
import json, pandas as pd

with open('data.json') as f:
    records = json.load(f)

pd.json_normalize(records).to_csv('data.csv', index=False)

Node has no built-in CSV writer, so the quoting rules are yours to get right. Double every quote inside a value and wrap anything holding a delimiter or a line break:

JavaScript, Node.js
const rows = JSON.parse(fs.readFileSync('data.json', 'utf8'));
const cols = [...new Set(rows.flatMap(Object.keys))];

const cell = v => /[",\n]/.test(v ?? '') ? '"' + String(v).replace(/"/g, '""') + '"' : (v ?? '');
const csv = [cols, ...rows.map(r => cols.map(c => cell(r[c])))]
    .map(r => r.join(',')).join('\n');

PHP has the writer built in, and fputcsv handles the quoting for you:

PHP
<?php
$rows = json_decode(file_get_contents('data.json'), true);
$out = fopen('data.csv', 'w');
fputcsv($out, array_keys($rows[0]));
foreach ($rows as $row) {
    fputcsv($out, $row);
}
fclose($out);

All three assume flat records. Nested keys need flattening first, which is the job pandas does with json_normalize and the reason the other two are longer than they look.

Common Use Cases

Anything that ends in a spreadsheet or a database usually starts with this conversion. The jobs we see most:

  • API responses into a report: pull a payload from Postman or curl and hand a stakeholder something they can sort and filter.
  • MongoDB and Firebase exports: both export JSON, and both are full of nested documents that need flattening before analysis.
  • Database seeding: most database import tools take CSV happily and JSON reluctantly.
  • Log analysis: NDJSON from a log shipper turns into a table you can pivot.
  • Migrations between tools: CRM, analytics and billing platforms almost all accept a CSV upload.
  • Spot checking: a table makes a missing field obvious in a way a wall of JSON never does.

Going the other way? The CSV to JSON Converter turns a spreadsheet export back into records. To read the result as a sortable table first, try the CSV Viewer, and if you are loading it into a database the CSV to SQL Converter writes the INSERT statements for you. When the JSON will not parse at all, JSON Repair is the quicker first stop.

Frequently Asked Questions

How do I convert a JSON file to CSV?

Open the file with the Open file button or drag it onto the input box, then copy or download the CSV that appears next to it. There is no upload step and no conversion button to hunt for, because the CSV is rebuilt every time the input or an option changes.

How do I convert nested JSON to CSV?

Paste it and leave the defaults alone. Nested objects become dotted column names like address.city and lists become numbered columns like tags.0. If you would rather keep the structure intact inside a single cell, set Nested data to Keep nested values as JSON text.

What happens when records have different keys?

Every record is inspected, not just the first one. Column names are collected in the order they first appear and any record missing a column gets an empty cell there, so a field that shows up only in the last record still makes it into the file. The column map marks those columns with a count so you can see which ones are partial.

Can it convert NDJSON or JSON Lines to CSV?

Yes. Paste NDJSON straight into the box. When the document as a whole is not valid JSON, each line is parsed on its own, and if they all parse those become your rows. That covers log files, MongoDB exports and streaming API output.

How big a JSON file can I convert?

There is no cap written into the tool. Conversion happens on your own machine, so the real limit is your browser memory rather than a server quota. Files in the low tens of megabytes are fine on a normal laptop. Past that a streaming script with jq or Python ijson will be kinder to your fan.

Why does my CSV open with everything in one column in Excel?

Your regional settings expect a different separator. Set Delimiter to Semicolon and try again, which is what Excel wants in most of Europe. If the characters are also garbled, turn on the UTF-8 byte order mark at the same time.

Can I choose which array becomes the rows?

Yes. Leave Rows to convert empty and the first list of records is used automatically, with a note telling you which one it picked. To override it, type a path such as data.users or results[0].rows.

What happens to null values?

By default a null becomes an empty cell, which is what spreadsheets expect. If your destination distinguishes between empty and missing, the Null values become menu can write null, NULL, or the backslash N marker that MySQL LOAD DATA uses.

Is my data sent to a server?

No. The converter is JavaScript running in your browser, so the JSON you paste never leaves your device. Nothing is logged, stored or shared, which matters when the payload is a customer export.

Is this tool free?

Yes, completely free with no account, no daily limit and no file size tier to buy.