How to Convert JSON to CSV
JSON and CSV are two of the most common ways to move data around. JSON is great for APIs and nested structures, while CSV is what spreadsheets like Excel and Google Sheets understand. Converting between them is an everyday task for developers, analysts and anyone cleaning up data — but nested JSON can make it tricky.
This guide explains exactly how a JSON document becomes a CSV table, what happens to nested objects and arrays, and how to convert your file in seconds without writing any code.
How JSON maps to rows and columns
A CSV file is a simple grid: the first row is the header (the column names) and every row after it is a record. JSON, on the other hand, is usually either a single object or an array of objects.
When you convert an array of objects, each object becomes one row, and each key becomes a column. A single object simply becomes a single row. The keys that appear across all objects are collected into the header, so even if some records are missing a field, every column is still represented.
What happens to nested objects and arrays
Real-world JSON is rarely flat. When a value is itself an object or an array, a good converter flattens it into dot-notation columns rather than dropping it. For example, {"user": {"name": "Al", "city": "NYC"}} becomes two columns, user.name and user.city.
Arrays are handled the same way: a list with several items keeps an index in the column name (items.0.price, items.1.price) so nothing is lost, while a single-item array is flattened without the index for a cleaner header. This is important — a poor converter simply shows the top-level keys and silently discards everything nested inside them.
Convert JSON to CSV in three steps
You do not need a script for a one-off conversion. Using the FilesSwift JSON to CSV tool:
- Open the JSON to CSV tool and upload your .json file.
- The tool flattens nested data into clear columns and builds standard CSV.
- Download the CSV and open it in Excel, Google Sheets or Numbers.
Tips to avoid data loss
Make sure your JSON is valid first — run it through a JSON formatter/validator to catch a stray comma or bracket. Values that contain commas, quotes or line breaks should be quoted in the output; a standards-compliant converter does this automatically.
If you plan to convert the CSV back to JSON later, keep the dot-notation headers intact — they let the reverse conversion rebuild the original nested structure.
Frequently asked questions
Does converting JSON to CSV lose nested data?
Not if the tool flattens nested objects and arrays into dot-notation columns. FilesSwift keeps every value; poorer converters drop anything nested.
Can I convert a single JSON object (not an array)?
Yes. A single object becomes one row, and an array of objects becomes one row per object.
Will the CSV open in Excel?
Yes. The output is standard comma-separated CSV that opens directly in Excel, Google Sheets or Numbers.
Is my data uploaded anywhere?
The file is processed securely and removed automatically; nothing is stored long term.