HomeFormattersDataJSON to CSV Converter

JSON to CSV Converter

Data

Convert a JSON array to CSV instantly — paste your JSON, choose a delimiter, and download or copy the CSV output. Runs entirely in your browser, nothing uploaded.

What is a JSON→CSV?

A JSON to CSV Converter transforms a JSON array of objects into comma-separated values format — the tabular structure used by spreadsheets, databases, and data analysis tools. Every object in the JSON array becomes one row in the CSV, and the keys of those objects become the column headers.

JSON is ideal for hierarchical, nested data — APIs, configuration files, and application logs are all naturally expressed in JSON. CSV, on the other hand, is the lingua franca of tabular data: every spreadsheet, BI tool, and data import wizard can read it. When you need to move data from a JSON API response into Excel, Google Sheets, Airtable, or a SQL import, converting to CSV is the standard step.

This converter handles the conversion entirely in your browser — no upload, no server, no rate limits. It supports all four common delimiters (comma, semicolon, tab, pipe), automatically adds a header row from the JSON keys, and correctly escapes fields that contain the delimiter character or quotes. Nested objects are flattened using dot-separated key paths (e.g. address.city) so the output stays truly flat.

For the reverse operation — converting a CSV file into a JSON array — use the CSV to JSON Converter.


How to use this JSON→CSV calculator

  1. Paste your JSON array into the JSON Array input field. The default shows a three-row example.
  2. Choose a Delimiter from the dropdown — comma is the default and works with most tools.
  3. Toggle Include header row on or off depending on whether you need column names.
  4. The CSV Output appears instantly as you type or change options.
  5. Click the Copy button to copy the CSV to your clipboard.
  6. Paste into a spreadsheet or save as a .csv file.

Formula & Methodology

Input requirements: A JSON array where each element is an object ([{}, {}, ...]). Arrays of primitives are also accepted and placed in a single value column.

Key collection: All keys across all objects are collected into an ordered set. The order follows the key order in the first object, with any additional keys from subsequent objects appended.

Flattening: Nested objects are recursively flattened. {"a": {"b": 1}} becomes {"a.b": 1}.

Field escaping (RFC 4180): A field is quoted if it contains the delimiter, a " character, a newline, or a carriage return. Inside quoted fields, " is escaped as "".

Before (JSON):
json [{"name": "Alice, Jr.", "score": 98}, {"name": "Bob", "score": 85}] 

After (CSV, comma delimiter):
name,score "Alice, Jr.",98 Bob,85
Frequently Asked Questions
What JSON structure does this converter support?
The converter expects a JSON array of objects — for example, [{"name": "Alice", "age": 30}]. Each object becomes one CSV row. Simple arrays of strings or numbers are also handled by placing all values in a single 'value' column. Nested objects are flattened automatically using dot notation (e.g. 'address.city').
What happens to nested objects in the JSON?
Nested objects are flattened using dot-separated key paths. For example, {"user": {"name": "Alice", "city": "Mumbai"}} produces columns named 'user.name' and 'user.city'. Arrays inside objects are converted to their string representation.
Does the converter add a header row?
Yes by default — the first row of the CSV contains the column names taken from the JSON keys. You can turn this off using the 'Include header row' toggle if you need raw data only.
How are commas and special characters inside values handled?
Any field containing the delimiter character, a double-quote, or a newline is automatically wrapped in double quotes per RFC 4180. Double-quote characters inside values are escaped by doubling them (""). This ensures the output is correctly parsed by Excel, Google Sheets, and standard CSV libraries.
Can I change the delimiter?
Yes — choose from comma, semicolon, tab, or pipe from the Delimiter dropdown. Semicolon-delimited CSV is common in European locales where the comma is used as a decimal separator. Tab-delimited output (TSV) pastes directly into spreadsheet cells without any import wizard.
Is my JSON data stored or uploaded?
No. The conversion runs entirely in your browser using JavaScript. Your JSON is never sent to a server or stored anywhere — it stays on your device.
What if the JSON objects have different keys?
The converter collects all keys across all objects in the array and uses the union as the header row. Rows missing a particular key will have an empty cell for that column. This handles sparse or schema-inconsistent datasets correctly.
Can I convert back from CSV to JSON?
Yes — use the [CSV to JSON Converter](/csv-to-json-formatter/) which is the reverse of this tool. Both tools support custom delimiters and optional header rows.
What is the difference between this and the JSON Formatter?
The [JSON Formatter](/json-formatter/) pretty-prints or minifies JSON while keeping it as JSON. This tool converts JSON into a completely different format (CSV) suitable for spreadsheets and tabular data processing.
Does this work with large JSON files?
The tool works in the browser and handles files up to a few thousand rows comfortably. Very large files (hundreds of thousands of rows) may slow the browser due to the size of the text rendered in the output box — for those, a command-line tool like jq is more practical.
Can I use the CSV output directly in Excel or Google Sheets?
Yes. Copy the CSV output and paste it into a blank spreadsheet, or save it as a .csv file and open it directly. If your delimiter is a comma, Excel and Google Sheets will parse it without any import configuration. For semicolon-delimited files, use the 'Import' wizard and specify the delimiter.