JSON ↔ CSV converter

Convert JSON arrays to CSV and CSV back to JSON. Configurable delimiters, dot-notation flattening for nested objects.

Delimiter

Converting between JSON and CSV

JSON and CSV are the two most common data interchange formats, each with distinct strengths. JSON (JavaScript Object Notation) supports nested structures, mixed types, and is the default format for web APIs. CSV (Comma-Separated Values) is flat, tabular, and universally supported by spreadsheets, databases, and data analysis tools.

Converting from JSON to CSV requires flattening: every JSON object in the array becomes a row, and every unique key across all objects becomes a column header. Objects with missing keys get empty cells. The reverse — CSV to JSON — maps each row to an object using the header row as property names.

The main challenge is handling mismatched schemas. In JSON, objects in the same array can have different keys. This tool unions all keys across all objects to produce a complete set of columns, filling in blanks where needed.

Handling nested JSON

CSV is inherently flat — it has rows and columns, nothing more. When JSON contains nested objects (like {"user": {"name": "Alice", "email": "a@b.com"}}), you need a flattening strategy.

Dot notation is the most common approach: user.name and user.email become column headers. It preserves the hierarchy in the column name, making it possible to reconstruct the original structure later. This tool uses dot-notation flattening by default.

For deeply nested data or arrays within objects, consider whether CSV is the right output format. Sometimes it's better to restructure or denormalise the JSON first, or to extract only the fields you need into a flat structure before converting.

Frequently asked questions

How does the tool handle nested JSON objects?
Nested objects are flattened using dot notation. If your JSON has { "address": { "city": "London", "postcode": "EC1A" } }, the CSV output will have columns named address.city and address.postcode. This approach preserves all data in a flat tabular format. Arrays within objects are converted to their string representation. For deeply nested structures, consider restructuring your JSON before converting — or use a dedicated ETL tool.
Can this handle large files?
This tool runs entirely in your browser using JavaScript, so the limit is your browser's available memory — typically several hundred megabytes. For files up to a few MB (tens of thousands of rows), performance is excellent. For very large datasets (100MB+), you'll get better performance with command-line tools like jq, csvkit, or miller, or with Python's pandas library which handles large files in streaming mode.