JSON to CSV Converter — Nested JSON Flattened Automatically
Paste any JSON array and get a clean CSV in one click. Nested objects flatten to dot.notation columns automatically. RFC 4180 compliant — ready for Excel, Google Sheets, and Python pandas. Runs entirely in your browser— your data never leaves your device.
More JSON Tools
JSON Compare
Compare two JSON files side-by-side
JSON to XML
Convert JSON into XML format instantly
JSON to YAML
Transform JSON to YAML format
JSON to Excel
Export JSON data to Excel (.xlsx)
JSON to SQL
Convert JSON to SQL INSERT queries
JSON to Text
Extract readable text from JSON
JSON to HTML
Convert JSON data to HTML tables
JSON Tree Viewer & Reader
Visualize JSON in expandable tree view
Perfect for developers exporting MongoDB, Firebase, or API responses to Excel.
How to Convert JSON to CSV (Live Example)
Converting JSON to CSV with our tool takes just three simple steps. Here's exactly what happens when you use it:
Paste Your JSON Data
Copy your JSON from an API response, file, or database export. Paste it into the editor above. You'll immediately see syntax highlighting—keys turn blue, strings turn green, and numbers turn orange. If there's a syntax error, you'll see a red underline showing exactly where the problem is.
Click "Convert to CSV"
Hit the green button. The converter parses your JSON, flattens any nested objects using dot notation (like user.address.city), and builds the CSV headers automatically from your data's keys.
View and Download Your CSV
The output panel appears showing your data in clean CSV format with the header row at the top. Each JSON object becomes one CSV row. Click "Copy" to grab it for pasting elsewhere, or "Download" to save a .csv file directly to your device.
How Nested JSON Gets Converted to CSV
Flat JSON is straightforward—but real-world API responses are almost always nested. Our converter uses dot notation flattening to handle every nesting pattern automatically.
1Nested Object → Dot Notation Columns
[{
"id": 1,
"user": {
"name": "Alice",
"address": {
"city": "Mumbai",
"zip": "400001"
}
}
}]id,user.name,user.address.city,user.address.zip 1,Alice,Mumbai,400001
Nested keys become column headers using dot notation: user.address.city
2Arrays of Primitives → Joined Cell
[{
"name": "Bob",
"tags": ["dev", "js", "api"]
}]name,tags Bob,"dev,js,api"
Primitive arrays are joined with commas and quoted to preserve CSV integrity.
3Inconsistent Keys → Empty Cells (No Crash)
[
{"id": 1, "name": "Alice", "email": "a@b.com"},
{"id": 2, "name": "Bob"}
]id,name,email 1,Alice,a@b.com 2,Bob,
Missing keys output as empty cells — headers are always built from the full union of all keys.
Your Data Stays Private
Every conversion happens entirely in your web browser using client-side JavaScript. Your JSON never leaves your device—there's no server upload, no cloud processing, and no temporary file storage.
- No data transmitted to external servers
- No analytics tracking on your JSON content
- Safe for production data, API keys, and sensitive information
- Works offline once the page loads
Large File Support
Our tool safely handles JSON files up to 5–10 MB directly in your browser. Since all processing happens client-side, performance depends on your device's memory and browser capabilities.
- Desktop recommended for files over 5 MB—more RAM means smoother conversion
- Split large files if you experience slowdowns—use a JSON splitter tool first
- Chrome or Edge typically offer the best performance for large datasets
Common JSON Errors & How to Fix Them
Before converting, your JSON must be valid. Here are the most frequent mistakes developers encounter and how to resolve them quickly:
Missing Commas Between Properties
JSON requires commas between every key-value pair in an object and between items in an array.
{"name": "John" "age": 30}{"name": "John", "age": 30}Unquoted Object Keys
Unlike JavaScript objects, JSON keys must always be wrapped in double quotes.
{name: "John"}{"name": "John"}Trailing Commas
JSON does not allow a comma after the last item in an object or array.
{"name": "John",}{"name": "John"}Mismatched Brackets or Braces
Every opening bracket needs a matching closing bracket. Nested structures make this error easy to miss.
{"users": [{"name": "John"}}{"users": [{"name": "John"}]}Single Quotes Instead of Double
JSON strictly requires double quotes for strings. Single quotes will cause a parse error.
{'name': 'John'}{"name": "John"}Convert JSON to CSV Programmatically
Prefer to automate conversions in your code? Here are production-ready snippets for the most common languages. For one-off conversions, the tool above is faster.
PythonUsing pandas (Recommended)
import pandas as pd
import json
# From a JSON string
json_data = '[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]'
df = pd.read_json(json_data)
df.to_csv('output.csv', index=False)
# From a JSON file
df = pd.read_json('data.json')
df.to_csv('output.csv', index=False)
# Nested JSON — use json_normalize
from pandas import json_normalize
with open('nested.json') as f:
data = json.load(f)
df = json_normalize(data) # flattens nested keys
df.to_csv('output.csv', index=False)Install: pip install pandas · Works with Python 3.7+
JavaScriptVanilla JS (No Library)
function jsonToCsv(jsonArray) {
if (!jsonArray.length) return '';
// Collect all unique keys (handles inconsistent objects)
const headers = [...new Set(jsonArray.flatMap(Object.keys))];
const rows = jsonArray.map(obj =>
headers.map(h => {
const val = obj[h] ?? '';
// Quote values containing commas, quotes, or newlines
const str = typeof val === 'object' ? JSON.stringify(val) : String(val);
return str.includes(',') || str.includes('"') || str.includes('\n')
? `"${str.replace(/"/g, '""')}"`
: str;
}).join(',')
);
return [headers.join(','), ...rows].join('\n');
}
// Usage
const data = [{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}];
const csv = jsonToCsv(data);
console.log(csv);Node.jsUsing json2csv Package
const { Parser } = require('json2csv');
const fs = require('fs');
const data = [
{ id: 1, name: 'Alice', city: 'Mumbai' },
{ id: 2, name: 'Bob', city: 'Delhi' }
];
const parser = new Parser();
const csv = parser.parse(data);
fs.writeFileSync('output.csv', csv);
console.log('Saved to output.csv');Install: npm install json2csv
💡 Tip: For one-time conversions or when you don't want to write code, the online tool above handles all of these patterns automatically—including nested JSON, special characters, and UTF-8 encoding.
Mobile-Friendly CSV Preview
Our converter is designed to work seamlessly on phones and tablets. The interface adapts to your screen size without sacrificing functionality:
- Horizontal scrolling tables – Wide CSV output scrolls left-right so you can view all columns without zooming out
- Touch-optimized buttons – Copy and Download buttons are large enough for easy tapping
- Responsive editor – The JSON input area resizes to fit your screen while maintaining readability
Compare JSON Conversion Formats
Not sure if CSV is the right format? Here's how it compares to other common data formats:
| Format | Best For | Tool |
|---|---|---|
| CSV | Spreadsheets, databases | Current page |
| XML | Legacy APIs, config files | JSON to XML |
| YAML | DevOps, CI/CD configs | JSON to YAML |
| SQL | Database inserts | JSON to SQL |
| HTML | Web display, reports | JSON to HTML |
Real-World Use Cases: What Developers Convert
Developers use this tool daily to process API responses and database exports. Here are the most common workflows:
MongoDB Export → CSV
Export your MongoDB collection using mongoexport --jsonArray, paste the output here, and get a clean CSV ready for Excel or Google Sheets analysis.
Stripe API Response → CSV
Fetch your Stripe charges or customers list via the API, paste the data array here, and convert payment records to a spreadsheet for accounting.
Firebase Firestore Export → CSV
Firebase exports data as JSON. Paste your Firestore document export directly—our tool handles the nested fields structure automatically.
Google Analytics 4 JSON → CSV
GA4's Data API returns JSON reports. Convert the rows array to CSV to build custom dashboards in Google Sheets or Power BI.
REST API Response → CSV Report
Any REST API returning a JSON array (users, orders, products, logs) can be pasted here and exported as a CSV report in seconds—no coding required.
Postman Response → CSV
Running API tests in Postman? Copy the response body JSON directly into the converter to export test results or API data as a spreadsheet.
Trust, Transparency & Expert Verification
This JSON to CSV Converter is independently developed and maintained by Raviraj Bhosale (Founder, jsonformatters.com) to provide developers and data analysts with a secure, character-perfect conversion environment.
Local Browser Conversion
Your data never leaves your machine. The conversion logic is executed entirely via client-side JavaScript, ensuring 100% data privacy.
RFC 4180 Standards
Our algorithm strictly follows the RFC 4180 technical specifications for CSV formatting, ensuring compatibility with Excel, SQL, and Python.
Technical Standards & Documentation:
Last Reviewed: February 2026 · Maintained by Raviraj Bhosale.


Expertise Behind the Tool
Hello! I’m a Web Developer and the founder of jsonformatters.com. My goal is to build tools for developers that are not only fast, but also completely secure and privacy-focused.
Keeping modern 2026 web standards in mind, I optimized this tool using React and Next.js to deliver the best possible performance.
I believe in complete transparency when it comes to my coding skills and projects. You can learn more about my professional experience by connecting with me on my LinkedIn Profile.
Frequently Asked Questions
How can I convert JSON to CSV online for free?
Paste your JSON array into the editor above and click 'Convert to CSV'. The conversion runs instantly in your browser—no signup, no file upload, completely free.
How do I convert JSON to CSV for Excel?
Convert your JSON using the tool, then click 'Download' to save the .csv file. Open it in Microsoft Excel using File → Open. Excel auto-detects the comma delimiter and maps each JSON key to a column.
Can I convert nested JSON to CSV?
Yes. Nested objects are automatically flattened using dot notation—for example, a nested key user.address.city becomes a column header. Arrays of primitives are joined with commas inside a quoted cell. See the nested JSON examples section above for visual walkthroughs.
What happens if my JSON objects have different keys?
The converter builds headers from the union of all keys across every object. If an object is missing a key, that cell is left empty in the output CSV—no errors, no crashes.
What is the maximum file size I can convert?
The tool handles JSON files up to 5–10 MB directly in your browser. For larger files, use a desktop tool like Python's pandas library (pd.read_json) which has no size limit.
Why should I convert JSON to CSV?
CSV is universally supported by Excel, Google Sheets, SQL databases, and data analysis tools like pandas and Power BI. JSON's nested structure is powerful for APIs but harder to analyze in tabular form—CSV makes filtering, sorting, and charting simple.
Is my data safe when converting JSON to CSV?
Yes. All conversion happens in your browser using client-side JavaScript. Your JSON is never uploaded to a server. You can even disconnect from the internet after the page loads and the tool still works.
How do I convert JSON to CSV in Python?
Use pandas: import pandas as pd — then df = pd.read_json('data.json') and df.to_csv('output.csv', index=False). For nested JSON, use pd.json_normalize() to flatten the structure first. See the full code example in the 'Convert Programmatically' section above.
Does the CSV output follow RFC 4180 standards?
Yes. The output follows RFC 4180—values containing commas, double quotes, or newlines are properly quoted, and embedded double quotes are escaped by doubling them. This ensures compatibility with Excel, Google Sheets, PostgreSQL COPY, and MySQL LOAD DATA INFILE.
What is the difference between JSON and CSV?
JSON (JavaScript Object Notation) supports nested objects, arrays, and mixed data types—ideal for APIs and configuration files. CSV (Comma-Separated Values) is a flat, tabular format with rows and columns—ideal for spreadsheets, databases, and data analysis. Converting JSON to CSV trades structural flexibility for analytical simplicity.
Language & Encoding Support
Our converter fully supports UTF-8 encoding, ensuring accurate conversion of international text and special characters.