JSON to CSV

Convert JSON files and JSON data into CSV format instantly with this free client-side converter. Secure, fast, and works directly in your browser.

Loading tool…

Turning nested JSON into a flat table

JSON is a tree: objects can contain objects, which can contain arrays of more objects, to any depth. CSV is a grid: rows and columns, nothing nested. Converting between them means flattening, and flattening always involves choices about how a tree becomes a table.

The usual approach is to treat each element of the top-level array as a row, and each leaf value as a column, joining nested keys into dotted paths so user.address.city becomes a single column name. Arrays inside a record either become indexed columns or a joined string. Fields missing from some records leave empty cells. Understanding this is what stops the output surprising you: a deeply nested payload can produce far more columns than you expected, and irregular records produce a sparse grid.

Why we built this tool

The reason is almost always the same: someone needs the data in a spreadsheet. An API returns JSON, but the finance team works in Excel, the analyst wants a pivot table, or a system will only import CSV.

That exported data is typically customer records, orders, or usage logs — precisely the material that should not be pasted into an unknown converter. We built this to run in the browser so the conversion is a local computation: your JSON is parsed, flattened, and re-serialised as CSV on your own machine, then downloaded. No upload, no row limit, no account. For anyone handling personal data under the GDPR, that difference is not a preference; it is the difference between a local operation and a transfer to a third party.

Tips and common mistakes

  • Deeply nested payloads produce very wide tables; flatten only the branch you need rather than the whole document.
  • Use a semicolon delimiter if the spreadsheet will be opened in a locale where the comma is the decimal separator.
  • Fields absent from some records leave blank cells, which is correct behaviour rather than data loss.
  • Long numeric identifiers can be mangled by spreadsheets into scientific notation — import them as text.

Open JSON to CSV with a link

JSON to CSV can be handed its input by the link that opens it, so the page arrives with the work already done. This is meant for assistants and scripts: if a chatbot, an editor extension, or a command-line agent already holds your content, it can build a link instead of asking you to copy and paste into a box.

The payload rides in the fragment — the part of a URL after the #. Browsers never send the fragment to a server, so anything handed over this way stays on your device exactly as a dropped file would. A link that uses the query string instead is rewritten into the fragment by the page before any analytics or ad script can read the address.

Prefix any field with gz#gztext= — to pass it as gzip-compressed base64url, which fits roughly five to ten times more into the same link. Links stay reliable up to about 8,000 characters; past that, chat apps and address bars start truncating them, and the page says so rather than loading half a document.

One exception to the privacy rule: ?url= tells the page to download the input from an address. That request goes from your browser straight to that server — not through ours — but it does leave your device, and it only works if the server allows cross-origin requests.

  • #text= — the text to work on
  • #json= — the JSON document

Example: https://mygadgets.ink/tools/json-to-csv/#text=...&json=...

Quick start: using JSON to CSV

  1. Paste or load the JSON you want to convert — usually an array of objects.
  2. Check the detected columns and adjust the delimiter if your spreadsheet expects semicolons.
  3. Run the conversion and review the first few rows in the preview.
  4. Confirm that nested fields flattened the way you expected.
  5. Download the CSV and open it in your spreadsheet application.

The reverse trip is CSV to JSON. If the source will not parse, check it with JSON Validator first.

Related Developer Tools

Browse all Developer Tools →