F
FreeConvertingTools

Convert JSON to CSV Online for Free

Convert JSON arrays to CSV spreadsheet format. Flatten nested objects, customizable output.

FreeNo SignupAPI Available

Ad space

Ad space

How to use the JSON to CSV

  1. 1

    Open the JSON to CSV tool

  2. 2

    Enter your data or upload your file

  3. 3

    Adjust settings if needed

  4. 4

    Get instant results

  5. 5

    Download or copy your output

Available as API

Integrate this tool into your app.

View documentation

Frequently asked questions

Is the JSON to CSV free?

Yes, our json to csv is 100% free with no limits, no signup, and no watermarks.

Do I need to create an account?

No. You can use the json to csv without any registration. Just open it and start using it.

Is my data safe?

Yes. Any files you upload are automatically deleted after 5 minutes. We never store, share, or access your data.

Does this work on mobile?

Yes. The json to csv is fully responsive and works on phones, tablets, and desktops.

Is there an API for this?

Yes. All our tools are available as API endpoints for developers. Check our API documentation for details.

JSON to CSV: Flattening Structured Data Back Into Rows

JSON is built for nesting — objects inside objects, arrays of records, keys that only sometimes appear — while a spreadsheet only understands a flat grid of rows and columns. A JSON-to-CSV converter bridges that gap by taking an array of JSON records and laying it out as one row per record and one column per distinct key, producing a file that Excel, Google Sheets, or any tool expecting delimited text can open directly. This converter runs the whole process in your browser: paste in a JSON array, and a CSV preview, a row/column count, and a downloadable file appear immediately, computed by JavaScript on your own device rather than a server somewhere else.

This direction of conversion tends to come up whenever data that started life as JSON — an API response, a database export, a log of form submissions — needs to land in front of someone using ordinary spreadsheet software, or needs to feed a legacy system that only accepts delimited files. Going from nested, variable-shaped JSON to a rigid grid involves a few real decisions along the way: which keys become columns, what happens to a key some records have and others don't, and how a value containing a comma or a quote gets written without breaking the file. This tool makes those decisions consistently so you don't have to work them out by hand each time.

How to Convert JSON Into CSV With This Tool

  1. Paste a JSON array into the left panel, or click Upload .json to load a file straight from your device — its contents are read locally by the browser and placed into the same input box, with the conversion then triggered automatically.
  2. Watch for the small status line under the input: a green "Valid JSON" confirms the parser accepted it, while a red error message names exactly what went wrong, so a stray trailing comma or an unclosed bracket doesn't fail silently.
  3. Toggle Flatten nested if your records contain nested objects — turning it on rewrites a nested key like an address's city into a single flattened column named address.city, rather than leaving the whole nested object dumped into one cell as raw text.
  4. Choose your delimiter (comma, tab, semicolon, or pipe) and decide whether to include a header row and whether string values get wrapped in quotes with the Headers and Quote strings checkboxes.
  5. Read the CSV straight out of the right-hand panel, where a row and column count updates live beneath it, then copy it to the clipboard or click to download a .csv file.

A single top-level JSON object, not wrapped in an array, is accepted too — the tool quietly treats it as a one-record array before converting, so you don't need to add the surrounding brackets yourself just to convert one object.

Why Convert JSON to CSV in the First Place

  • Handing data to someone who lives in spreadsheets. A colleague in sales, finance, or operations often just wants to open a file in Excel and filter or sort it — asking them to read raw JSON instead is rarely a realistic option.
  • Feeding a legacy import tool. Plenty of older systems, and even some modern ones, only accept CSV as a bulk-upload format, regardless of how the data was originally produced.
  • Turning an API response into a report. Pulling records from a REST endpoint and immediately reshaping them into a spreadsheet is a common way to get from "raw data" to "something a manager can glance at" without writing a full reporting pipeline.
  • Archiving in a plain-text, tool-agnostic format. CSV opens in almost anything, forever, which makes it a reasonable long-term archival choice for data that currently happens to live as JSON.
  • Comparing or diffing records in a spreadsheet. Sorting, filtering, and side-by-side comparison are often just easier in grid form than scrolling through a JSON array looking for the one record that changed.

How Column Order and Quoting Are Actually Decided

Two design decisions shape every conversion this tool performs, and both matter more than they might first appear. The first is how columns get chosen and ordered: for an array of objects, the column set is the union of every key that appears across all the records, listed in the order each key is first encountered — not sorted alphabetically, and not limited to whichever keys happen to be on the first record. That matters because JSON records inside one array don't have to share an identical shape; a later record can introduce a key the earlier ones never had, and that key still earns its own column rather than getting silently dropped. A record missing a given key simply produces an empty cell in that column rather than an error.

The second decision is what counts as "an array" to convert in the first place, and here the tool draws a firm line: valid input is an array of objects, or an array of arrays, but never a mix of the two and never an array of bare primitives like plain numbers or strings. An array of arrays is treated as already-tabular — each inner array becomes a row exactly as written, with no header row inferred, since there are no keys to draw one from. Whichever shape you're converting, any field whose value contains the chosen delimiter, a double quote, or a line break gets wrapped in quotes automatically, with any quote character already inside that value doubled so the result stays valid CSV rather than corrupting the column boundary around it.

Input Shapes: What's Accepted and What Gets Rejected

Input shapeResult
Array of objects, e.g. [{"a":1},{"a":2,"b":3}]Header row from the union of keys, one data row per object
Array of arrays, e.g. [["a","b"],["1","2"]]Each inner array becomes a CSV row as-is, no header inferred
A single object, not wrapped in an arrayOn this page: auto-wrapped into a one-record array and converted
An array of plain strings or numbersRejected — there's no key or column structure to build a grid from
A mix of objects and arrays in one arrayRejected — the shape has to be consistently one or the other

That third row is a real difference between the two places this conversion runs. The on-page tool's own JavaScript checks whether the parsed value is an array at all and, if it's a plain object instead, wraps it in one automatically before proceeding. The API version described further down is stricter: it requires the input to already be a JSON array and rejects anything else outright, so a single bare object sent to the API comes back as an error rather than being silently promoted into a one-item array.

What Happens to Nested Objects

Nested data is where the on-page tool and the API genuinely part ways in behavior, and it's worth knowing which one you're relying on. With Flatten nested switched on — the default in the browser tool — a record like a user object containing an inner address object gets rewritten so the nested keys surface as their own dot-notation columns, turning a deep structure into several flat, spreadsheet-friendly ones instead of a single unreadable cell. Switch that option off, and a nested value is left as a raw JSON string crammed into one cell, which is sometimes exactly what you want if a downstream system is going to re-parse that cell as JSON anyway. The API doesn't currently offer a flattening step at all: a nested object or array found as a field's value is converted to its JSON-string form and quoted into a single cell, full stop, with no dot-notation option to request instead.

Manual Conversion vs. Using This Tool

  • Writing a nested loop over keys and rows yourself. Manageable for one flat, uniform dataset, but the union-of-keys logic, the quoting rules, and nested-value handling all have to be reinvented correctly every single time you do this from scratch.
  • A spreadsheet application's own JSON import feature. Some programs offer one, but support and behavior vary widely between products, and it still means launching a full application for a conversion that takes seconds on a page.
  • A scripting language's built-in CSV writer. The right choice when this step is part of a larger automated job rather than a one-time task, since it composes cleanly with the rest of a script.
  • This tool's metered API. The identical conversion logic — union-of-keys column ordering, delimiter escaping, the objects-or-arrays-only rule — is available as a REST endpoint accepting a json string and an optional delimiter, returning the resulting CSV text; a server, script, or CI job can call it directly instead of a person visiting this page.

How This Tool Handles Your Data

Everything on this page is computed locally: the moment you type or paste JSON, the conversion into CSV happens inside your own browser's JavaScript engine, with nothing transmitted to any server just to get an answer. The same conversion is also reachable as a metered API endpoint for anyone who needs it inside a script or a backend job rather than a browser tab — call it that way, and the JSON body you send does travel to our server to be processed, a real distinction from the page you're looking at now, which keeps everything on your own machine from start to finish.

Why did my nested "address" object turn into separate columns?

The Flatten nested option, on by default, rewrites nested keys into dot-notation column names like address.city and address.zip so a spreadsheet program can display each piece as its own readable column instead of one cell full of raw JSON text. Turn that option off if you'd rather keep the nested value intact as a JSON string inside a single cell.

Can I convert a single JSON object, or does it have to be an array?

On this page, yes — a bare object is automatically wrapped into a one-item array before conversion, so you can paste either shape and get a sensible result. The metered API is stricter and expects an actual JSON array already; sending it a single object without the surrounding brackets returns an error rather than a silent conversion.

What happens to an array value inside one of my JSON fields?

An array field, like a list of tags attached to a record, is joined with a pipe character into a single string for that cell by the on-page tool, rather than being split across multiple columns — there's no fixed number of tags to reserve columns for in advance, so joining into one cell keeps every row the same width.

Will a comma inside one of my text fields break the CSV?

No. Any field whose value contains the delimiter you've chosen, a double quote, or a line break is automatically wrapped in quotes, with an internal quote doubled, so the field reads back correctly as one value rather than splitting into extra columns.

Why does my output have more columns than the first record in my array?

The column list is built from every key across every record, not just the first one — if a later record introduces a key the earlier ones never had, that key still gets its own column, and the earlier records simply show an empty cell there instead of the column being dropped.

Related Tools

If you need to go the other way later, CSV to JSON parses a spreadsheet export back into structured records with the same header and delimiter logic in reverse. For configuration-style data rather than tabular rows, JSON to YAML turns the same kind of JSON into a human-readable document instead of a grid. If your JSON originally came from parsing an XML file, XML to JSON is likely the tool that produced it in the first place, and understanding its output shape can explain a nested field you're now trying to flatten.

Ad space

Related tools

Ad space