Worked example: orders from an API
An API answer has its orders inside data.orders, each with a nested customer and a list of items. The converter finds the list at data.orders and makes 6 columns: id, total, customer.name, customer.country, items.0, items.1. The first row reads A-17,42.5,Ruth,US,mug,tea. The second order has only one item, so its items.1 cell is empty. With “Joined in one cell” the items collapse into one column instead: A-17,42.5,Ruth,US,mug; tea.
{
"data": {
"orders": [
{
"id": "A-17",
"total": 42.5,
"customer": {
"name": "Ruth",
"country": "US"
},
"items": [
"mug",
"tea"
]
},
{
"id": "A-18",
"total": 9,
"customer": {
"name": "Owen",
"country": "UK"
},
"items": [
"card"
]
}
]
}
}
How the columns are made
- Order: columns appear in the order keys are first met, so the first record’s keys come first and keys that only later records have are added on the right.
- Missing keys leave an empty cell;
nullalso becomes an empty cell. True and false are written as true and false. - Empty objects and arrays become {} or an empty cell, so the column still exists.
- Quotes and commas inside values are written by the CSV rules (RFC 4180): the cell is wrapped in quotes and quotes inside are doubled.
CSV and spreadsheet formulas
A CSV cell that starts with = or + is run as a formula when the file is opened in a spreadsheet. If your JSON comes from users (names, comments, addresses) that can be abused to run commands or leak data, an attack called CSV injection. With protection on, such cells are written with an apostrophe in front, which spreadsheets show as plain text. Real numbers such as -12 are left alone.
JSON Lines and big files
Log files and data exports often use JSON Lines: one JSON object per line instead of one big array. The converter recognises that format and reads each line as a record. Everything happens in memory on your device, so files of a few tens of megabytes work on most computers; very large exports are better split first.
When you need JSON as CSV
Analysts are often handed JSON from an API, a webhook log or a database export, but the people who use the numbers work in spreadsheets. Converting to CSV lets them sort, filter, build pivot tables and charts without writing code. The dot-path column names keep the link to the original structure, so a developer can read the spreadsheet and know where each value came from. For very wide data, choose “Joined in one cell” so that lists of tags or categories don’t create dozens of mostly empty columns. If the JSON is deeply nested, check the preview: a column per nested value can be exactly right for an order and its customer, while a list of order lines usually belongs in its own table.
Related tools
- CSV to JSON
- CSV to Excel
- PDF to Excel
- Markdown to Excel
- JSON formatter (on Aultra Tech)
- Remove duplicate lines
Sources
Checked on November 26, 2026:
- RFC 4180: Common format and MIME type for CSV files
- RFC 8259: The JSON data interchange format
- JSON Lines format
- OWASP: CSV injection
Frequently asked questions
How do I convert JSON to CSV?
What happens to nested objects?
How are arrays handled?
My JSON is an API response, not an array. Will it work?
Will Excel open the CSV correctly?
Is the data uploaded?
Last updated: 2026-11-26