JSON to CSV Converter - Convert JSON to Excel
Convert JSON data to CSV format for Excel and Google Sheets import
Example data loaded — edit or paste your own JSON below.
Tip: Input should be a JSON array, e.g. [{"name":"John","age":30}, ...]
JSON to CSV: A Practical Guide for Developers
If you work with APIs, you know the routine: the endpoint returns clean, structured JSON, but your stakeholder wants a spreadsheet. Maybe it's 5000 customer records from MongoDB that the marketing team needs in Excel for a pivot table. Or a data warehouse export destined for Tableau or Power BI. JSON is the universal format for APIs and data exchange — lightweight, hierarchical, easy to parse programmatically. But most business tools don't speak JSON. They speak CSV.
Converting JSON to CSV by hand sounds simple until you actually try it. Nested objects need flattening. Keys need to be collected across an entire array to build the header row. Commas inside values need escaping. Fields that appear in some objects but not others need to be handled gracefully. A five-minute manual conversion spirals into an hour of edge cases.
This tool handles all of that in the browser. Paste a JSON array, set a few options, and get a properly formatted CSV. No server round-trip, no signup, no upload. The converter auto-detects all unique keys across your array, builds a complete header row, and outputs one clean CSV row per object.
How to Use
Start by pasting your JSON array into the input panel on the left. The tool expects an array of objects — [{"key":"value"}, ...] — which covers most API responses, database exports, and JSON dumps. If your data is in a .json file, just open it in any text editor and copy the contents.
Before converting, configure the output with three controls:
- Delimiter: Comma for standard CSV. Semicolon for European locales where comma is the decimal separator (French prices like 12,50 EUR need a different field separator). Tab for pasting directly into spreadsheet cells without going through an import wizard. Pipe for datasets that contain many commas and quotes.
- Header row: Toggle to include or exclude column names. Including headers (default) makes the CSV self-documenting. Excluding them is useful when you're appending to an existing CSV or piping the output into another tool that expects raw data rows.
- Flatten nested objects: When enabled (default),
{"address": {"city": "NYC", "zip": "10001"}}becomes two columns:address.cityandaddress.zip. Arrays inside objects are serialized as JSON strings in their column. When disabled, nested objects stay as raw JSON strings in a single cell — useful if you plan to parse them later in your spreadsheet or database.
Click Convert to CSV and the right panel populates immediately. From there, hit Download — the file includes a UTF-8 BOM so Excel detects the encoding correctly and renders non-ASCII characters without garbling — or Copy to paste directly into a spreadsheet cell.
Real-World Scenarios
A data engineer pulls 5000 user records from a MongoDB collection. The raw output is a JSON array. Rather than writing a Python script with csv.DictWriter, handling None values manually, and mapping nested fields to flat columns, they paste it here, click convert, and hand the CSV to the marketing team — who immediately build a pivot table in Excel. What would have been a 20-minute scripting task becomes 30 seconds.
A BI analyst connects their dashboard to an internal REST API. The API returns JSON arrays, but Tableau's data connector expects CSV uploads. They copy the API response, paste, convert, download, and import directly into Tableau. No middleware layer, no scheduled ETL job, no asking engineering to build an export endpoint.
A backend developer is debugging a data migration between two systems. Their ORM dumped 200 rows as a JSON array for inspection. They convert to CSV, diff against a previous export in a visual diff tool, and confirm that no records were lost or altered during the migration — then share the clean CSV with the product manager so everyone can verify the results.
Input / Output
The converter scans all objects in the array to collect every unique key for the header row. If some objects have fields that others don't — inconsistent schemas are common in real-world data — those rows simply get empty values for the missing columns. Nothing breaks.
[
{"name":"Alice","dept":"Engineering","salary":95000},
{"name":"Bob","dept":"Marketing","salary":82000},
{"name":"Carol","dept":"Engineering","salary":105000}
]
name,dept,salary Alice,Engineering,95000 Bob,Marketing,82000 Carol,Engineering,105000
Common Issues & FAQ
"JSON must be an array" is the most frequent error. The converter needs a top-level array to generate rows. If you have a single object like {"name":"Alice","age":30}, wrap it in brackets: [{"name":"Alice","age":30}]. If you have a JSON object containing multiple arrays, extract the one you need first.
Nested objects are controlled by the flattening toggle. With it on (default), nested properties cascade into dot-notation columns: {"user":{"profile":{"email":"[email protected]"}}} becomes user.profile.email. Deeply nested structures of three or more levels are fully flattened. With flattening off, nested objects stay as raw JSON strings in a single column — convenient when you plan to parse them downstream with a scripting language.
Null values become empty CSV fields — two adjacent delimiters with nothing between them, like Alice,,95000. This is correct CSV behavior: null has no text representation. Excel displays these as blank cells. If your use case requires explicit NULL text, pre-process your JSON (replace null with "NULL" strings) before converting.
Special characters — commas, double quotes, embedded newlines — are escaped automatically per RFC 4180. The converter wraps problematic values in double quotes and escapes internal quote characters by doubling them. If your data is particularly comma-heavy (addresses, descriptions, free-text fields), switching the delimiter to semicolon or pipe avoids quote-wrapping altogether.
Performance: the converter uses JSON.parse, loading the entire array into browser memory. On a typical machine with 8GB of RAM, you can comfortably process datasets up to roughly 200,000 rows and 500 columns. Beyond that, use a command-line streaming parser: jq -r '.[] | [.id,.name,.dept] | @csv' data.json > output.csv. This tool is optimized for the 90% use case — quick, ad-hoc conversions that would otherwise require a script.
Every step of the conversion — JSON parsing, key detection, flattening, CSV generation — runs entirely in your browser using standard JavaScript APIs. Your data never leaves your device. No upload, no server-side processing, no logging. You can safely convert customer records, financial transactions, employee data, or proprietary business information with zero privacy risk.