JSON to CSV
Convert a JSON array of objects to CSV, flattening nested fields.
This tool needs JavaScript enabled to run in your browser.
What this tool does
This tool turns a JSON array of objects into CSV, ready for a spreadsheet or a data-driven test. Nested objects are flattened into dotted column names, so address.city becomes its own column. You can also pass a single object and get one row.
How flattening works
Each object becomes a row. A nested object contributes one column per leaf value, named by its path, such as user.address.city. Arrays are expanded by index, so tags.0 and tags.1 each get a column. When objects have different shapes, the header is the union of every key, and missing values are left blank.
Delimiters and escaping
Pick comma, semicolon or tab to match the tool you are importing into. A semicolon helps when your data contains commas, or when your spreadsheet uses a comma as the decimal separator. Any value that contains the delimiter, a quote or a line break is wrapped in quotes and its quotes are doubled, following the common CSV convention.
Common use cases
- Opening an API response in a spreadsheet.
- Turning JSON fixtures into CSV for data-driven tests.
- Sharing a slice of data with someone who prefers a spreadsheet.
Frequently asked questions
- What JSON shape does it expect?
- An array of objects, or a single object. Nested objects and arrays are flattened into dotted column names such as user.name.
- What if rows have different keys?
- The CSV header is the union of all keys in first-seen order, and missing values are left blank.
Learning resources
Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.