JSON to CSV Converter

Enter JSON data in the text area. Get properly quoted CSV output with column headers, ready to copy into a .csv file.

Updated June 2026 · How this works

How It Works
The formula, explained simply

The JSON to CSV converter parses your JSON data structure and transforms it into comma-separated values format. When you input a JSON array of objects, the converter first identifies all unique property names across all objects to create column headers. Each object becomes a row, with property values mapped to their corresponding columns.

For nested objects or arrays within your JSON, the converter serializes them back to JSON strings within the CSV cells. This preserves complex data while maintaining CSV compatibility. The tool wraps every value in double quotes and escapes internal quotes by doubling them.

Delimiter selection affects how spreadsheet applications interpret your CSV file. Comma is the RFC 4180 default; Excel set to a locale that writes decimals with a comma expects a semicolon instead; tab makes a TSV file that many database import tools accept; and a pipe keeps the file easy to read when your data is full of commas.

Header inclusion creates a first row with column names, making the CSV self-documenting and easier to import into databases or analysis tools. Without headers, you get pure data rows, useful when appending to existing CSV files or when column order is predefined.

When To Use This
Right tool, right situation

Use JSON to CSV conversion when transferring data from APIs or NoSQL databases into relational databases, spreadsheet applications, or statistical analysis tools. This conversion bridges the gap between modern web services outputting JSON and traditional data analysis workflows expecting tabular formats.

The converter excels for one-time data exports, report generation, and data migration projects. Convert user export requests, transform API responses for Excel reports, or prepare JSON logs for analysis in R or Python pandas. It handles varying object structures gracefully, making it ideal for real-world data where not every record has identical fields.

Avoid this conversion for frequently updated data streams where maintaining a direct JSON processing pipeline would be more efficient. Similarly, heavily nested JSON with multiple array levels may require preprocessing or a specialized flattening approach rather than direct CSV conversion.

Common Mistakes
Why results sometimes look wrong

The most common JSON to CSV conversion mistake is assuming all objects have identical properties. Real-world JSON often has missing or additional fields across objects. This converter makes a column for every field it finds and leaves an empty cell where a record lacks one (or holds null), so check that your target system reads an empty cell the way you mean it.

Delimiter choice errors occur when your data contains the chosen separator character. This converter wraps every value in double quotes, so the CSV stays valid whatever the delimiter; trouble starts when the program reading it splits on the delimiter without honoring quotes. Test a small sample in your target program first. Whole numbers above 9,007,199,254,740,991 (2^53 − 1) lose precision when a browser parses JSON, so store long IDs as strings. Text whose first character, after any spaces or line breaks, is =, +, -, @ or a full-width form of one, and text that starts with a tab or a carriage return, is written with a leading apostrophe ('=1+1 instead of =1+1), because Excel and Google Sheets would otherwise run it as a formula when the file is opened (CSV injection, OWASP). A plain number such as -5 is left as a number. Remove the apostrophe only for data you trust.

Nested object handling requires attention - the converter serializes complex values as JSON strings, which may not import correctly into systems expecting flat data. Consider flattening your JSON structure before conversion, or post-process the CSV to extract nested values into separate columns for database compatibility.

The Math
Worked examples and deeper derivation

Quoting follows RFC 4180; rows end with a line feed rather than RFC 4180's carriage return plus line feed, which spreadsheet programs also accept. The algorithm extracts unique keys from all JSON objects using Set operations to ensure consistent column ordering. Every value is wrapped in double quotes, and a double quote inside a value is doubled.

The conversion process maps each JSON object to a CSV row by iterating through the standardized header array and extracting corresponding values. Missing properties and null become empty cells, keeping the same column count on every row, while 0, false and empty strings are written as they are. Complex nested structures serialize using JSON.stringify() to preserve data integrity.

A line break inside a value stays inside that value's quotes, so a multi-line note remains one cell. This ensures the CSV maintains data fidelity while remaining parseable by standard CSV readers.

Convert customer data
JSON array with customer names, emails, and order totals
Creates a CSV file ready for import into CRM systems or spreadsheet analysis.
Export API response
API JSON response with product listings and prices
Transforms API data into CSV format for Excel reporting or database import.
Process survey results
JSON survey responses with participant answers and timestamps
Converts survey data to CSV for statistical analysis in R, Python, or SPSS.

Common questions

How do I convert JSON array to CSV format?
Paste your JSON array into the converter, choose your delimiter preference, and the tool generates properly formatted CSV with headers. Each object in your JSON array becomes a row in the CSV output.
Can I convert single JSON object to CSV?
Yes, the JSON to CSV converter handles both arrays and single objects. A single object creates a one-row CSV file with column headers extracted from the object properties.
What delimiter should I use for CSV files?
Comma is the standard CSV delimiter for most applications. Use a semicolon for Excel in locales that write decimals with a comma, tab for tools that expect TSV, or pipe when your data is full of commas.

Need something this doesn't cover?

Suggest a tool — we'll build it →