The staff file every way below is tested on
Most conversion guides describe each method in the abstract, which makes them impossible to compare. This one does the opposite: every way below runs on the same three-record file, so the outputs are directly comparable. The file is small but not trivial — it has a nested object (dept with team and floor), a list (skills), and the two edge cases that trip up real conversions: a boolean (active) and an empty list (Lina has no skills).
If a method cannot handle this file cleanly, it will not handle your real file either. If it can, you know exactly what its output looks like before you trust it with anything bigger. Keep the file in mind as you read: the correct answer has six columns (id, name, dept.team, dept.floor, skills, active) and three rows, with Ana skills reading chat; phone and Lina skills reading empty.
[
{ "id": 1, "name": "Ana", "dept": { "team": "Support", "floor": 2 }, "skills": ["chat", "phone"], "active": true },
{ "id": 2, "name": "Ken", "dept": { "team": "Sales", "floor": 3 }, "skills": ["email"], "active": false },
{ "id": 3, "name": "Lina", "dept": { "team": "Support", "floor": 2 }, "skills": [], "active": true }
]Way 1: an online converter — the no-install way
Open a free online JSON to CSV converter, paste the JSON or upload the file, and download the CSV. That is the whole method, and for a one-off file it is the right one: there is nothing to install, nothing to learn, and the result is ready in under a minute. The converter on this site runs entirely in your browser, so the file never leaves your machine, and its flattening toggle decides how nested data is handled.
With flattening switched on, the staff file converts to exactly the six-column answer above: dept becomes dept.team and dept.floor, the skills list joins into one cell with a semicolon separator, and Lina empty list becomes an empty cell. With flattening off, the same file keeps dept and skills as JSON text inside single cells — valid CSV, but not a table you can sort or filter. Our earlier guide on flattening JSON to CSV documents the toggle cell by cell, including its edge cases.
The honest limits: an online converter is a one-file-at-a-time tool. If you need to convert fifty files every morning, or the conversion has to happen inside another program, one of the ways below fits better. And if your list itself is what you want to analyze — one row per skill, not one row per person — no online converter does that; you need the explode recipe in our guide to flattening the JSON data.
id,name,dept.team,dept.floor,skills,active
1,Ana,Support,2,chat; phone,true
2,Ken,Sales,3,email,false
3,Lina,Support,2,,trueWay 2: the spreadsheet you already own — Excel Power Query
If the CSV is headed for a spreadsheet anyway, you may not need a converter at all: Excel can read JSON directly through Power Query. Open a blank workbook, go to Data, Get Data, From File, From JSON, pick the file, and Power Query shows you the records. Expand the dept column to flatten the nested object into team and floor columns, expand or extract the skills column depending on whether you want one row per skill or one joined cell, then Close and Load. The result lands as a real Excel table, ready to filter and pivot.
Two things to know before you start. First, the expand step is per nested column: a file with three levels of nesting needs three expansions, and it is easy to miss one and end up with a column of Record values. Second, opening a finished CSV in Excel has its own traps — a UTF-8 file can open with garbled characters, and a value like 007 can lose its leading zero — which is why our guide to making CSV from JSON covers the validate-by-re-import habit: open the result, check the characters, check the codes, and only then call it done.
Google Sheets is the one gap in this way. Sheets has no native JSON import: there is no File, Import, JSON option. The practical routes are pasting through an online converter first, or a small Apps Script that fetches and parses the JSON. If you are already in Sheets, the converter route is faster; if the import has to repeat daily, the script route wins.
Way 3: code you already run — Python or jq
If you already write code, Python and jq are the two workhorses, and they disagree in one instructive way. Python pandas json_normalize flattens nested objects into dot-notation columns automatically — dept becomes dept.team and dept.floor with no extra step — but it leaves lists as Python repr strings unless you join them yourself. Run it without the join and Ana skills cell reads ['chat', 'phone'], which is a list printed as text, not a value you can use. The one-line join fix is in the snippet below, and the output then matches the online converter exactly.
jq takes the opposite approach: it does nothing automatically, and every column is explicit. You name each field, you choose the join, and you get exactly the header row you wrote. That explicitness is jq real strength for one-off conversions of awkward files, and its weakness for wide files — a record with forty fields means forty expressions. For the staff file, both tools produce the same six columns and three rows, which is the point: the way changes, the correct answer does not.
One more Python note for the recurring case: json_normalize plus explode turns a list into one row per item, which is the explode move no online converter offers. If your analysis needs one row per skill, that is the recipe — it is covered in full, with a verified jq equivalent, in our guide to flattening the JSON data.
import json
import pandas as pd
rows = json.load(open('staff.json'))
df = pd.json_normalize(rows)
df['skills'] = df['skills'].apply(lambda v: '; '.join(v))
df.to_csv('staff.csv', index=False)
# staff.csv:
# id,name,skills,active,dept.team,dept.floor
# 1,Ana,chat; phone,True,Support,2
# 2,Ken,email,False,Sales,3
# 3,Lina,,True,Support,2Way 3, continued: the jq one-liner
The jq version of the same conversion is a single command. The header row is written out by hand, then each record maps to one row: the nested fields are addressed with dots (dept.team), the list is joined with a semicolon, and @csv handles the quoting. Run it on the staff file and you get the same three rows as the Python version, with one cosmetic difference: jq quotes every string field, so the header row reads "id","name",... instead of id,name,.... Both are valid CSV; every spreadsheet and parser reads them identically.
jq earns its place for a second reason: it works on files too big to open in an editor. The one-liner above loads the whole file into memory, which is fine for anything up to tens of megabytes, but jq also has a streaming mode (the --stream flag) that processes a file record by record. If your JSON file is hundreds of megabytes, streaming jq or a chunked Python script is the way; a browser tab is not.
jq -r '(["id","name","dept.team","dept.floor","skills","active"] | @csv),
(.[] | [.id, .name, .dept.team, .dept.floor, (.skills | join("; ")), .active] | @csv)' staff.json
# "id","name","dept.team","dept.floor","skills","active"
# 1,"Ana","Support",2,"chat; phone",true
# 2,"Ken","Sales",3,"email",false
# 3,"Lina","Support",2,"",trueWay 4: your editor — VS Code
If you already live in VS Code, the conversion can happen without leaving the editor. The fastest route is the integrated terminal: open the folder, open a terminal inside VS Code, and run the Python or jq command from Way 3 — the output CSV appears in the same folder, and VS Code Excel viewer extensions or the built-in preview let you check it immediately. For people who prefer clicks over commands, extensions such as Rainbow CSV or a JSON-to-CSV extension convert the open file through the command palette.
The editor route real advantage is iteration: when the JSON is a config file or an API response you are already editing, converting in place keeps you in context, and the editor diff view shows you exactly what changed. The full walkthrough — extension, terminal, and a one-keypress task — is in our VS Code guide, including the traps (an extension that stringifies nested data, a terminal that writes to the wrong folder). The short version: VS Code is a fine place to convert, but the conversion itself is still one of the other ways wearing an editor costume.
Way 5: inside your own app — a library call
The fifth way is for when conversion is not a one-off task but part of something you are building: a dashboard export button, a nightly report, a data pipeline. Then you do not reach for a tool at all — you call a function. The snippet below is the core of it in JavaScript: walk the dotted column names, join list values, escape anything containing a comma, quote, or newline by doubling the quotes and wrapping the cell. Run it on the staff file and it produces exactly the same rows as the online converter, which is no coincidence: this site converter engine is the same idea, with the edge cases (ragged rows, nested lists, empty objects) handled.
The decision here is build versus borrow, and the honest answer is usually borrow: pandas json_normalize, a CSV library in your language, or the converter engine pattern below will beat a hand-rolled version on edge cases. Write your own only when the conversion has rules no library offers — a custom flattening scheme, a domain-specific join, a streaming requirement. And if the conversion runs on a server, remember the privacy difference: a browser converter keeps the file on the user machine, while a server converter sees the data.
const rows = require('./staff.json');
const cols = ['id', 'name', 'dept.team', 'dept.floor', 'skills', 'active'];
const get = (r, p) => p.split('.').reduce((o, k) => o?.[k], r);
const esc = v => { const s = String(v ?? '');
return /[",\n]/.test(s) ? '"' + s.replace(/"/g, '""') + '"' : s; };
console.log(cols.join(','));
for (const r of rows)
console.log(cols.map(c => esc(c === 'skills' ? (get(r, c) || []).join('; ') : get(r, c))).join(','));
# id,name,dept.team,dept.floor,skills,active
# 1,Ana,Support,2,chat; phone,true
# 2,Ken,Sales,3,email,false
# 3,Lina,Support,2,,trueWhen there is no good way
A guide that only says yes would be lying by omission, because there are files where conversion to CSV is the wrong move, and knowing that saves more time than any tool. The first case is deeply nested or graph-shaped data: a comment thread where comments contain replies that contain replies, or records that reference each other. Flattening that into columns produces either hundreds of sparse columns or a lossy summary, and the honest answer is to keep it as JSON or query it with jq instead of flattening it.
The second case is mixed schemas: a file where one record has keys the others lack, or the same key holds a string in one record and an object in another. A converter handles this by taking the union of all keys and leaving empty cells, which is correct but often useless — the resulting table is mostly holes. Before converting, ask whether the records are really the same kind of thing; if not, split the file by record type first, then convert each part.
The third case is scale: a file too big for the tool at hand. A browser converter chokes somewhere in the tens of megabytes, an editor import stalls, and even pandas slows down. The fix is not a better converter but a different shape: split the file, stream it with jq --stream, or skip CSV entirely and keep the data as JSON Lines (one JSON object per line), which streams naturally and stays queryable. Our guide to converting large JSON to CSV online covers the size question in full.
Which way should you pick?
Pick by your situation, not by the tool reputation. One file, once, and you want it done: Way 1, the online converter. The result has to land in a spreadsheet you will keep working in: Way 2, Power Query. You already write code and the file is awkward or the conversion will repeat: Way 3, Python or jq. You are already editing the file in VS Code: Way 4, the integrated terminal. The conversion has to happen inside software you ship: Way 5, a library call.
Two tiebreakers settle most remaining cases. If privacy matters — the file holds customer data, credentials, anything you would not email — prefer a way that keeps the data on your machine: a browser converter, a local script, or your editor. If the file is huge, prefer a way that streams: jq --stream or a chunked Python script, not a browser tab. Everything else is taste and habit, and any of the five ways produces the same correct CSV for a well-shaped file.
What every way has to decide
Whichever way you pick, four decisions are hiding inside it, and two files converted with different answers to them are not the same CSV. Flattening: do nested objects become dotted columns, or stay as JSON text in a cell? Delimiter: comma, semicolon, tab, or pipe — and does your spreadsheet expect the same one? Header row: are column names included, and are they the names your downstream tool expects? Encoding: plain UTF-8, and does your spreadsheet open it as UTF-8 or as something else?
These are not advanced topics; they are the decisions that decide whether the CSV opens correctly on the first try or the fifth. Our guide to making CSV from JSON walks through all seven decisions that turn raw data into a working file, with each one tested against the real converter. Read it once, and every conversion after it gets faster.
Related guides
- How to Convert JSON to CSV: 3 Reliable Methods (2026 Guide)
- How Do I Convert JSON to CSV in VS Code? 4 Ways, From Click to One Keypress (2026 Guide)
- How to Flatten the JSON Data: Explode, Join, or Leave It Nested (2026 Guide)
- How to JSON to CSV Online: Do It in This Tab in 30 Seconds (2026 Guide)
- JSON to CSV Converter Download: What You Should Actually Download (2026 Guide)
- Convert Large JSON to CSV Online Free: How Big Is Too Big? (2026 Guide)
- What Is a JSON and CSV File? A Beginner's Guide to Both Formats (2026 Guide)
- What Does Flattening a JSON Mean? The Term Explained (2026 Guide)
- What Is JSON to CSV Online? The 3 Words Explained (2026 Guide)
- What Is JSON to CSV Converter Online? Anatomy of the Tool (2026 Guide)
- Convert JSON to CSV Locally: Keep the File on Your Machine (2026 Guide)
- What Are Ways to Convert JSON to CSV Locally? 6 Methods, Compared (2026 Guide)
- Why Your CSV Opens in One Column in Excel, and How to Fix It (2026 Guide)
- Why Your CSV Shows Weird Characters in Excel, and How to Fix the Encoding (2026 Guide)
- Why Excel Drops the Leading Zeros From Your CSV Codes, and How to Keep Them (2026 Guide)
- Why Excel Changes Your CSV Dates, and How to Keep Them (2026 Guide)
- Why Saving Your CSV in Excel Changes It, and How to Keep the Original Safe (2026 Guide)
- Why Excel Won't Open Your Big CSV File, and What to Do Instead (2026 Guide)
Frequently asked questions
Is there a free way to convert JSON to CSV?
Yes — all five ways in this guide are free. An online converter is free with no sign-up, Excel Power Query is included in Excel, Python and jq are free and open source, VS Code is free, and the JavaScript approach uses only the standard library. You never need to pay to convert JSON to CSV.
Is there a way to convert JSON to CSV without installing anything?
Yes. Use a free online converter: paste the JSON or upload the file in your browser and download the CSV. The converter on this site runs entirely in your browser, so nothing is installed and the file never leaves your machine. If the file is already open in a spreadsheet you own, Power Query is also install-free.
Is there a way to convert JSON to CSV without writing code?
Yes — two of them. An online converter needs no code at all: paste, convert, download. Excel Power Query also needs no code: import the JSON file, expand the nested columns by clicking, and load the result as a table. Code only becomes useful when the conversion has to repeat or the file is awkward.
Is there a way to convert JSON to CSV in Excel?
Yes, with Power Query: Data, Get Data, From File, From JSON. Expand each nested column to flatten objects into dotted columns, expand or extract list columns depending on whether you want one row per item or one joined cell, then Close and Load. Google Sheets has no equivalent native import — paste through an online converter or use a small Apps Script instead.
Is there a way to convert a large JSON file to CSV?
Yes, but not in a browser tab. For files in the tens of megabytes and up, use jq streaming mode (jq --stream), which processes the file record by record instead of loading it all, or a chunked Python script that reads and writes in batches. If the file is hundreds of megabytes, consider keeping it as JSON Lines (one JSON object per line) instead of CSV.
Is there a way to convert JSON to CSV that keeps nested data intact?
Yes — convert with flattening switched off. Nested objects and lists then stay as JSON text inside single cells, so nothing is lost, but the result is not a sortable table. If you need both — real columns and nothing lost — flatten the parts you analyze and keep the rest as JSON text, or explode the list you need into one row per item.
Is there a way to convert CSV back to JSON?
Yes, the reverse trip is just as well supported. Our guide to converting CSV to JSON covers three reliable methods: an online converter, a Python and pandas snippet, and the honest two-step through Excel or Google Sheets, since neither exports JSON natively. The same four decisions — flattening, delimiter, header, encoding — apply in reverse.
One file, one minute, no install
Paste JSON or upload a file: nested objects flatten to dot-notation columns, lists join into clean cells, and the download is plain UTF-8. Free, no sign-up, runs entirely in your browser.
Open the JSON to CSV converter