How to Convert JSON to CSV for Excel and Google Sheets
Step-by-step guide to converting JSON data to CSV format. Export JSON arrays to spreadsheets with our free online converter.
Need to analyze JSON data in Excel or Google Sheets? This guide shows you how to convert JSON to CSV format quickly and accurately.
What is JSON to CSV Conversion?
JSON to CSV conversion transforms structured JSON data into a flat, tabular format that spreadsheet applications can read. Each JSON object becomes a row, and each key becomes a column header.
JSON input:
[
{ "name": "Alice", "age": 28, "city": "London" },
{ "name": "Bob", "age": 32, "city": "Paris" },
{ "name": "Carol", "age": 25, "city": "Tokyo" }
]CSV output:
name,age,city
Alice,28,London
Bob,32,Paris
Carol,25,TokyoHow to Convert JSON to CSV Online
Step 1: Open the JSON Editor
Go to jsoneditor.io. No account or signup required.
Step 2: Paste Your JSON Array
Paste your JSON data into the editor. For CSV conversion, your JSON should be an array of objects where each object has the same keys.
Step 3: Convert to CSV
Click the Convert dropdown menu and select JSON to CSV. The converter will:
- Extract all unique keys as column headers
- Flatten nested objects using dot notation
- Handle arrays within objects
- Escape special characters properly
Step 4: Download or Copy
Copy the CSV output to your clipboard or download it as a .csv file. Open it directly in Excel or import it into Google Sheets.
Handling Nested JSON
Real-world JSON often contains nested objects. The converter flattens these using dot notation:
Nested JSON:
[
{
"name": "Alice",
"address": {
"city": "London",
"country": "UK"
}
}
]Flattened CSV:
name,address.city,address.country
Alice,London,UKHandling Arrays in JSON
When JSON objects contain arrays, the converter handles them in several ways:
JSON with arrays:
[
{
"name": "Alice",
"skills": ["JavaScript", "Python"]
}
]CSV output (joined):
name,skills
Alice,"JavaScript, Python"Common Use Cases
Export API Data to Excel
Many APIs return JSON data. Convert it to CSV to:
- Create reports and dashboards
- Share data with non-technical stakeholders
- Perform analysis in Excel or Google Sheets
Database Export
Export database records as JSON, then convert to CSV for:
- Data migration between systems
- Backup in human-readable format
- Analysis with spreadsheet tools
Log Analysis
Convert JSON log files to CSV for:
- Filtering and sorting in spreadsheets
- Creating charts and visualizations
- Sharing with team members
Best Practices
- Ensure consistent structure - All objects should have the same keys for clean CSV output
- Handle null values - Decide how to represent missing data (empty string, "null", etc.)
- Check date formats - Dates may need reformatting for Excel compatibility
- Escape special characters - Commas and quotes in values need proper escaping
Converting CSV Back to JSON
Need to go the other way? jsoneditor.io also converts CSV to JSON:
- Paste your CSV data
- Click Convert > CSV to JSON
- Each row becomes a JSON object with column headers as keys
Frequently Asked Questions
Why is my JSON not converting to CSV?
The most common reason is that your JSON is not an array of objects. CSV requires tabular data where each item has the same structure.
How do I handle very large JSON files?
jsoneditor.io processes files up to 512MB in your browser. For larger files, consider using command-line tools like jq or Python scripts.
Can I customize the CSV delimiter?
Yes, some converters let you choose between comma, semicolon, or tab delimiters depending on your region's Excel settings.
Summary
Converting JSON to CSV is straightforward with jsoneditor.io. Paste your JSON array, click convert, and download the CSV file. Works with nested objects, handles special characters, and processes everything locally in your browser for privacy.
André Figueira