JSON to CSV Converter

Convert JSON data to CSV format online. Download as .csv file. Free JSON to spreadsheet converter.

About JSON to CSV

Convert JSON arrays to CSV format. Supports nested objects (flattened with dot notation), arrays, and mixed data types. Download the result as a .csv file.

Video Tutorial

2:25

Video coming soon — full transcript available below

Chapters

Full transcript searchable
0:00

Why JSON to CSV conversion is needed

Welcome to this JSON to CSV Converter tutorial. APIs return data as JSON because it's flexible and supports nested structures. But most data analysis tools — Excel, Google Sheets, Tableau, Power BI — work with CSV or spreadsheet formats. When you need to analyze API data, share data with non-developers, import records into a CRM, or create a report from database exports, converting JSON to CSV is the bridge between developer tools and business tools.

0:28

Paste JSON array and convert

Open the JSON to CSV Converter on ToolPilot.dev. Paste your JSON into the input panel. The tool expects a JSON array — a list of objects where each object represents a row. For example a list of user objects each with name and age properties. Click Convert. The tool extracts all unique keys from the array and uses them as CSV column headers. Each object becomes a row. The output appears in the CSV preview panel.

0:58

Download the CSV file

After conversion, click Download CSV. A CSV file downloads to your computer with the correct .csv extension and comma-separated values. Open it directly in Excel or Google Sheets. The first row contains the column headers from the JSON keys. Each subsequent row is one JSON object. Values are properly quoted if they contain commas, newlines, or double quotes.

1:25

Handling nested objects and arrays

Real-world API responses often have nested objects — for example, a user object with an address sub-object. The converter flattens nested objects using dot notation for column names: address.street, address.city, address.zip. Nested arrays are serialized as JSON strings within the CSV cell. This preserves the data while making it importable into spreadsheet tools that don't natively handle nested structures.

1:52

Use case: exporting API data to Google Sheets

A common workflow: call an API endpoint in your terminal with curl or in Postman, copy the JSON response, paste it into the JSON to CSV converter, download the CSV, and open it in Google Sheets or import it with File > Import. This entire workflow takes under a minute and requires no coding. For regular data exports, you'd automate this in a script, but for ad-hoc analysis it's the fastest approach.

2:15

Wrap-up

The JSON to CSV Converter on ToolPilot.dev handles conversion entirely in your browser. Your data never leaves your computer, making it safe for confidential business data. It supports JSON arrays of any size within browser memory limits and handles edge cases like missing fields (fills with empty values) and special characters. Visit ToolPilot.dev for this and 19 other free developer and data tools.

Transcript covers all 6 chapters (2:25 total).

Frequently Asked Questions

What does the JSON to CSV converter do?
The JSON to CSV Converter takes an array of JSON objects and converts it into a comma-separated values (CSV) file. Each JSON object becomes a row, and the object's keys become the column headers.
What JSON format is required for conversion to CSV?
The converter expects a JSON array of flat objects: [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]. Nested objects require flattening first. The keys of the first object are used as CSV headers.
Can I convert nested JSON to CSV?
Nested JSON objects do not directly map to flat CSV columns. You need to flatten the JSON first — either manually by restructuring the data, or using a tool like jq in the command line: jq '[ .[] | {name: .user.name, email: .user.email} ]'.
How do I open a CSV file in Excel or Google Sheets?
Download the converted .csv file from the tool, then open it in Excel (File → Open) or Google Sheets (File → Import). Ensure the delimiter is set to comma if prompted.
What happens to special characters in JSON values when converting to CSV?
The converter handles special characters correctly: values containing commas or quotes are wrapped in double quotes, and existing double quotes are escaped by doubling them (""), following the RFC 4180 CSV standard.
Can I convert CSV back to JSON?
The reverse conversion (CSV to JSON) requires a different tool. You can do it in Python: import csv, json; rows = list(csv.DictReader(open('file.csv'))); print(json.dumps(rows, indent=2)).
What is the CSV format standard?
CSV (Comma-Separated Values) is defined by RFC 4180. Fields are separated by commas, rows by newlines, and fields containing commas or quotes are enclosed in double quotes.
How do I convert JSON to CSV in Python?
In Python: import json, csv; data = json.loads(json_string); writer = csv.DictWriter(file, fieldnames=data[0].keys()); writer.writeheader(); writer.writerows(data). Use the online tool for quick one-off conversions.
What is the maximum JSON size the converter handles?
The browser-based converter handles JSON files up to a few megabytes comfortably. For larger datasets, use command-line tools like jq or Python's csv and json modules.

Code Examples

Ready-to-use implementations in popular programming languages. Copy, paste, and run.

Convert JSON to CSV in JavaScript
// Convert array of objects to CSV
function jsonToCsv(data) {
  if (!data.length) return '';
  const headers = Object.keys(data[0]);
  const rows = data.map(obj =>
    headers.map(h => JSON.stringify(obj[h] ?? '')).join(',')
  );
  return [headers.join(','), ...rows].join('\n');
}

const data = [
  { name: 'Alice', age: 30, city: 'NYC' },
  { name: 'Bob', age: 25, city: 'LA' },
];
console.log(jsonToCsv(data));

Related Workflow Guides

Compare with alternatives