JSON to CSV in Python vs JavaScript vs a Browser Tool: Which Should You Reach For?
Oct 12, 2026 · AI-assisted
You've got a JSON payload sitting on your screen — maybe a Stripe webhook dump, maybe a 4MB API response with three levels of nested objects — and someone wants it as a spreadsheet by end of day. The reflex is to open a terminal. But which one: a Python one-liner, a Node script, or just dropping the file into a converter and moving on?
I've done all three, and the honest answer is that they solve different problems. Here's how to pick without wasting an afternoon.
Quick comparison
| Approach | Setup | Nested JSON | Privacy | Best for |
|---|---|---|---|---|
Python (pandas / csv) | Needs Python + packages | Manual flattening or json_normalize | Local | Repeatable pipelines, big files |
| JavaScript (Node/browser) | Node install or a scratch HTML file | You write the flatten loop | Local | Frontend devs, quick scripts |
| JSON ↔ CSV Converter | None — open the page | Built-in flatten (free up to 10 levels) | Runs in your browser, no upload | One-off conversions, client handoffs |
A quick note on that last row, because it's the one people are skeptical about: the converter uses PapaParse and SheetJS locally in your browser. Your file doesn't get posted to a server. That matters when the JSON contains customer emails, order IDs, or anything you'd rather not paste into a random web form.
When the browser tool wins
If your goal is "get this JSON into Excel and send it," scripting is overkill. Open the converter, drop the .json file, pick JSON→CSV or JSON→Excel (.xlsx), and download. Three steps, no pip install.
It wins clearly in a few situations:
- Nested objects you didn't design. API responses love to bury fields like
customer.address.city. The tool flattens nested JSON automatically — free up to 10 levels deep — so you getcustomer.address.cityas its own column instead of[object Object]. - You need .xlsx, not .csv. Excel export is a separate button, not a workaround. If a client asked for a workbook, that's the path.
- You're on a machine you don't control. A locked-down work laptop with no Python and no admin rights is exactly where a browser tool earns its keep.
- You want to eyeball the result first. Paste, convert, look at the output, copy it. No temp files cluttering your project folder.
Free tier handles files up to about 25MB. If you're regularly pushing bigger payloads, batch-converting, or need deeper flattening, there's an optional one-time Pro tier ($9.99) that raises the ceiling to 50MB, adds batch conversion up to 10 files, custom delimiters, and API URL fetch. Nothing about the free path is crippled for normal use.
When to use alternatives
Be honest with yourself: a browser tool is the wrong answer for some jobs.
Use Python when the conversion is part of something bigger. If this JSON arrives every night and the CSV feeds a warehouse load, you want a script, not a manual click. pandas.json_normalize() handles nested structures well, and you can chain the output straight into a database write or an S3 upload:
import pandas as pd
df = pd.json_normalize(data, sep=".")
df.to_csv("out.csv", index=False)
The sep="." argument is the part people miss — it's what turns nested keys into flat dotted column names instead of leaving you with dicts in cells.
Use Node when you're already in JavaScript. If you're debugging an API in the same repo, a small script keeps everything in one language. There's no built-in flatten, so you write a recursive walker — fine for a known schema, tedious for a messy one.
Use a database or ETL tool when the data is genuinely large. Once you're past a few hundred MB, you want streaming and chunking, not any single-file converter. That's a different class of problem.
And skip the upload-based web converters entirely if the data is sensitive. Some of them store your file. You have no way to verify what happens after the request completes. The privacy page explains how Toolkite handles this differently — the processing happens on your device.
How to convert JSON to CSV in the browser
- Paste or upload. Drop a
.jsonor.csvfile, or paste the raw text. Free tier accepts up to ~25MB. - Pick a direction. JSON→CSV, CSV→JSON, or JSON→Excel (.xlsx).
- Download. Copy the result or save the file. Done.
If the output looks wrong, the usual culprit is an array of objects where one object is missing a key. The flattener will still produce columns; some rows just come out empty in those cells. That's expected behavior, not a bug — and it's the same thing your Python script would do.
A note on arrays inside objects
A field like "tags": ["a", "b", "c"] doesn't have a single obvious CSV representation. Some tools join with a delimiter, some create numbered columns, some stringify the array. Before you commit to a format, check what your downstream consumer expects — a spreadsheet reader and a database loader will want different things. If you need custom delimiters for that join, that's a Pro option.
Edge cases worth knowing
- Deeply nested payloads. Ten levels of free flattening covers almost everything real. Past that, you're probably looking at a schema that should be normalized before it ever reaches a CSV.
- Mixed types in one field. If
idis sometimes a number and sometimes a string, CSV doesn't care — everything becomes text. Excel will sometimes helpfully reformat it anyway. Watch for that on import. - Unicode and emoji. Both PapaParse and SheetJS handle UTF-8 correctly, but if you open the CSV in an old spreadsheet app, check the encoding setting.
- Very wide output. Flattening a wide API response can produce 80+ columns. That's valid CSV, just unpleasant to read. Consider dropping fields you don't need before converting.
The short version
If you're converting once and moving on, use the browser converter — it's faster than any script and your data stays on your machine. If the conversion is recurring, embedded in a pipeline, or feeding a system, write the Python or Node script and stop doing it by hand. The two approaches aren't competitors; they're for different days of the week.
FAQ
Can I convert nested JSON to CSV without writing a flatten function?
Yes — the browser converter flattens nested objects automatically, free up to 10 levels deep. That covers the vast majority of API responses, where fields like user.address.zip need to become their own columns. If you're scripting instead, Python's pandas.json_normalize() with sep="." does the same job.
Is a browser converter safe for JSON containing customer data?
It depends on the tool. Toolkite's converter runs PapaParse and SheetJS locally in your browser, so the file isn't uploaded to a server. Upload-based converters are a different story — you can't verify what happens to your data after the request. For anything with PII, check that processing is client-side before you paste.
What's the file size limit for JSON to CSV conversion?
The free tier handles files up to roughly 25MB. If you regularly work with larger payloads, the optional Pro tier raises that to 50MB and adds batch conversion for up to 10 files at once. For anything in the hundreds of megabytes, you want a streaming script rather than a single-file converter.
Should I use Python or JavaScript for JSON to CSV conversion?
Python is the better pick if the conversion is part of a repeatable pipeline — pandas handles nested data cleanly and chains into database or storage steps. JavaScript makes sense if you're already working in Node and want to stay in one language, though you'll write the flatten logic yourself since there's no built-in equivalent.
Why does my converted CSV have empty cells in some rows?
That usually means your JSON is an array of objects where some objects are missing a key. The converter still creates the column, but rows without that field come out blank. It's normal behavior and matches what a Python script would produce — the schema is just uneven across records.
Can I export JSON directly to Excel instead of CSV?
Yes. The converter offers JSON→Excel (.xlsx) as a separate option alongside JSON→CSV, so you don't have to convert to CSV and then re-save it in a spreadsheet app. That's useful when a client specifically asked for a workbook rather than a plain text file.