JSON to CSV: How to Convert JSON Data to CSV Format
JSON powers the web. CSV powers spreadsheets. Converting between them is one of the most common data tasks โ here's how to do it correctly.

Try the tool right now
JSON to CSV Converter
What is JSON to CSV Conversion?
JSON (JavaScript Object Notation) and CSV (Comma-Separated Values) are two of the most common data formats in computing โ but they serve completely different purposes. JSON is hierarchical, supports nested structures, and is the standard for APIs and modern apps. CSV is flat, tabular, and the universal language of spreadsheets.
Converting JSON to CSV transforms hierarchical data into a row-and-column structure that opens cleanly in Excel, Google Sheets, Numbers, and any database tool. The process maps each object in a JSON array to a row, and each unique key across all objects to a column header.
Why Convert JSON to CSV?
- Spreadsheet analysis โ Open API responses in Excel for filtering, sorting, pivoting
- Data export for non-technical users โ Marketing, finance, and ops teams expect CSV
- Database imports โ Most database tools import CSV directly via COPY or LOAD DATA
- Email reports โ CSV files attach cleanly to emails and open without special software
- Machine learning preprocessing โ Many ML tools (pandas, scikit-learn) prefer CSV
- Bulk operations โ Update or migrate data via CSV when APIs are unavailable
- Backup and archival โ Plain text CSV is more durable than database-specific formats
How JSON Maps to CSV
The conversion follows simple rules:
- Each object in the JSON array becomes one CSV row
- Each unique key across all objects becomes one CSV column header
- Values containing commas, quotes, or newlines are wrapped in double quotes
- Embedded double quotes are escaped by doubling them (" becomes "")
- Missing fields in some objects show as empty cells in the CSV row
- Nested objects need to be flattened first (more on this below)
Example: [{"name":"Alice","age":30},{"name":"Bob","city":"Mumbai"}] becomes a CSV with three columns (name, age, city) where Bob's age and Alice's city show as empty.
How to Use Our JSON to CSV Converter
- Paste your JSON array into the input box (must be an array of objects)
- Choose your delimiter: comma, semicolon (European locales), or tab
- Click 'Convert' to generate the CSV
- Copy the result with one click, or download as a .csv file ready to open in Excel
- Use the 'Sample' button to load example JSON if you want to see the conversion in action
Handling Nested JSON
Real-world JSON often contains nested objects and arrays, which don't map cleanly to flat CSV. Common approaches:
Our tool expects a JSON array of flat objects. For deeply nested JSON, flatten the structure first using a programming language or specialized tool.
Flatten with dot notation
{"user":{"name":"Alice"}} becomes a column 'user.name'. Most converters can do this, but our basic tool expects pre-flattened data.
Stringify nested objects
Convert nested objects to JSON strings within a single CSV cell. Preserves structure but harder to analyze in Excel.
Pivot arrays to multiple rows
If a user has 3 hobbies, create 3 rows (or 3 columns hobby_1, hobby_2, hobby_3). Depends on what analysis you'll do.
Pre-process before converting
Use a tool like jq or a Python script to flatten complex JSON first, then convert the flat result.
Common Use Cases for JSON to CSV
- Exporting API responses for stakeholder review
- Migrating data between services that don't share APIs
- Generating Excel reports from web app data
- Importing user data into CRM tools (Salesforce, HubSpot)
- Preparing data for visualization tools (Tableau, Power BI)
- Creating mailing lists from API exports
- Bulk updating records via CSV import
- Archiving production data in human-readable format
Troubleshooting JSON to CSV Conversion
Error: 'Input must be a non-empty array'
JSON to CSV requires a top-level array. {"users": [...]} won't work directly โ extract the inner array first. Some tools auto-detect, but for portability, pass arrays explicitly.
Encoding issues in Excel
Excel sometimes mangles non-ASCII characters. Save the CSV as UTF-8 with BOM, or use Excel's 'Get Data' โ 'From Text/CSV' wizard which lets you specify encoding.
Commas appearing in data
Values containing commas should be wrapped in double quotes. Our converter handles this automatically. If you see broken columns, switch to semicolon or tab delimiter.
Different objects with different keys
Our converter handles this gracefully โ each unique key gets its own column. Missing values appear as empty cells. Excel handles this fine.
Final Thoughts
JSON to CSV conversion is one of the most common data manipulation tasks for developers, analysts, and business users alike. Whether you're exporting API data for a stakeholder, migrating between systems, or just opening data in Excel for ad-hoc analysis, our free online JSON to CSV converter handles the conversion in seconds. With support for multiple delimiters, automatic value escaping, and download-ready CSV output, plus full browser-based privacy (your data never leaves your device), it's a tool worth bookmarking for daily use.
Try JSON to CSV Converter NowFrequently Asked Questions
What format does my JSON need to be in?
A JSON array of objects, like [{"key":"value"},...]. Single objects, deeply nested structures, or non-array JSON need to be reshaped first. Our tool will show an error if the format isn't compatible.
Can I convert nested JSON to CSV?
Not directly. CSV is a flat format, so nested objects need to be flattened first (using dot notation like 'user.name') or stringified into a single cell. Use a script or specialized tool to flatten complex JSON before converting.
Why are there extra quotes in my CSV?
CSV requires values containing commas, quotes, or newlines to be wrapped in double quotes. This is correct CSV behavior โ Excel and Google Sheets handle it perfectly when importing.
Will this work with Excel and Google Sheets?
Yes. The output is standard RFC 4180 CSV, compatible with Excel, Google Sheets, Numbers, LibreOffice Calc, and database import tools. Open the downloaded .csv file directly or paste the text into a spreadsheet.
What's the difference between comma, semicolon, and tab delimiters?
Comma is the default. Semicolon is common in European locales where commas are used as decimal separators. Tab (TSV) avoids ambiguity entirely. Choose whichever your destination tool expects.
Is my data secure when using this tool?
Yes. The conversion happens entirely in your browser using JavaScript. Your JSON data is never uploaded, stored, or logged on any server. Even confidential data is safe to convert.
Related Articles

JSON Formatter Online: Format, Validate & Beautify JSON (Free Tool)
Working with messy JSON? Learn what a JSON formatter does, why it matters for developers, and how to format any JSON in seconds with our free online tool.

API Response Formatter: Format JSON & XML API Responses Online
Raw API responses are often a wall of unreadable text. Format JSON or XML responses instantly with auto-detection โ your debug sessions just got faster.

Online Regex Tester: Test Regular Expressions in Real-Time
Regex is the difference between 50 lines of string parsing and a single elegant pattern. Learn the fundamentals and test your expressions live in your browser.