# How to convert JSON to CSV: nested objects, lists inside cells, and opening the file in Excel without broken columns

> An API gave you JSON and your manager wants a spreadsheet. Here is how the conversion works, what happens to nested data, why a wrapper object trips people up, and the Excel surprises (lost zeros, garbled Hindi, wrong delimiter) that appear after the conversion looks perfect.

Published 2026-10-23 by Toolcloak. 6 minute read. Original: https://toolcloak.com/articles/how-to-convert-json-to-csv-nested-objects-lists-inside-cells-and-opening-the-file-in-excel-without-broken-columns
Related free tool: [JSON to CSV](https://toolcloak.com/tools/json-to-csv)

JSON is how programs talk to each other. A spreadsheet is how people read numbers. The moment someone asks “can you send that as an Excel file?”, you have a JSON-to-CSV problem. Flat data converts in a second. The trouble starts with nested objects, lists inside records, and a handful of Excel habits that quietly damage the result. This guide covers both the conversion and the cleanup.

> **In short**
> - Paste a JSON **array of objects** into [JSON to CSV](https://toolcloak.com/tools/json-to-csv). Each object becomes a row and each key a column.
> - **Nested objects are flattened** into columns named with dots, such as `address.city`.
> - A **list inside a record** stays in one cell as JSON text. It is not split into extra rows.
> - Choose the delimiter (comma, semicolon, tab or pipe) and whether to include the header row.
> - If the JSON is wrapped in an outer object like `{"data": [...]}`, **paste only the inner array**.

## The basic conversion

CSV is a plain text table: one line per row, values separated by a delimiter, and the first line usually holding the column names. JSON that is already shaped like a table, a list of records that all have the same keys, maps onto it directly.

1. Open the [JSON to CSV](https://toolcloak.com/tools/json-to-csv) tool.
2. Paste your JSON into the box, or use the built-in sample to see how it works.
3. Pick the **delimiter**: comma, semicolon, tab or pipe.
4. Leave **Include header row** on if you want the column names on the first line.
5. Press **Convert to CSV**. The result appears below along with the number of rows and columns.

Try it: [JSON to CSV](https://toolcloak.com/tools/json-to-csv). Paste a JSON array, choose a delimiter, and press Convert to CSV.

Here is the tool’s own sample, two people with three fields each, and what comes out.

| JSON | CSV result |
| --- | --- |
| `[{"name":"Asha","age":25,"city":"Pune"},` | `name,age,city` |
| ` {"name":"Ravi","age":31,"city":"Delhi"}]` | `Asha,25,Pune` |
|  | `Ravi,31,Delhi` |

*Two objects become two rows. The three keys become three columns, so the tool reports 2 rows and 3 columns.*

## What happens to nested data

Real API data is rarely flat. A customer record has an address inside it, and the address has its own fields. A table has no way to put one cell inside another, so the tool **flattens** the inner object: each inner key becomes a column named after its path, joined with a dot.

| In the JSON | Column in the CSV |
| --- | --- |
| `"id": 1` | `id` |
| `"address": { "city": "Jaipur", "pin": "302001" }` | `address.city` and `address.pin` |
| `"skills": ["sql", "excel"]` | `skills` (one cell holding the list as text) |

Take two customers where the second has less information than the first. The tool builds the list of columns from **every record** and keeps them in the order they first appear. A record that lacks a key simply gets an empty cell.

**Two nested records, one flat table**

|  | Value | Note |
| --- | --- | --- |
| Rows | 2 | One per customer |
| Columns | 5 | id, name, address.city, address.pin, skills |
| For missing keys | Empty | The second record has no pin and no skills |
| For the skills list | 1 cell | Shown as text, not split into rows |

*Input: id 1 Meera, Jaipur 302001, skills sql and excel. Then id 2 Kabir, Surat, with nothing else.*

The output for those two records, with a comma delimiter, looks like this:

`id,name,address.city,address.pin,skills`

`1,Meera,Jaipur,302001,"[""sql"",""excel""]"`

`2,Kabir,Surat,,`

The list in the last column is wrapped in quotes, and each quote inside it is doubled. That is the standard CSV way to protect a value that contains quotes and commas, and every spreadsheet understands it.

## Lists inside records stay in one cell

If a record holds a list, for example an order with three items, the tool does **not** create three rows. It keeps the list as JSON text in a single cell. That is the safest behaviour, because it never invents or duplicates data, but it means a list of objects will not become a clean sub-table by itself.

- **If you need one row per item**, convert the inner list on its own. Paste just that list (or merge the pieces first) and convert it separately.
- **If the list is simple**, such as tags or skills, the text in the cell is often good enough to filter on.
- **To go the other way** and turn a table back into records, see [CSV to JSON](https://toolcloak.com/articles/csv-to-json-how-to-convert-with-commas-quotes-and-line-breaks-inside-fields-and-the-mistakes-that-corrupt-data).

## The wrapper object trap

A great many APIs do not return a bare list. They return an object with the list inside it, like `{"status": "ok", "data": [ ... ]}`. If you paste that whole thing, the tool treats it as **one** record. You get a single row, and the `data` column holds the entire list as text.

**The same response, pasted two ways**

| Pasted with the wrapper | Pasted as the inner array |
| --- | --- |
| 1 row | One row per record |
| `status` and `data` become the columns | Start at the `[` that opens the list |
| All your records sit in one cell as text | End at the matching `]` |
| Looks like a conversion that “did not work” | Each record becomes its own row |

*When the result has far fewer rows than you expected, this is almost always the reason.*

Select from the opening square bracket of the list to its closing bracket and paste only that part. If you are not sure where the list starts, the [JSON Formatter](https://toolcloak.com/tools/json-formatter) will lay it out with indentation, and the [JSON Path Finder](https://toolcloak.com/tools/json-path) helps locate it. A stray comma is another common cause of failure, and our guide on [why your JSON will not parse](https://toolcloak.com/articles/why-your-json-wont-parse-and-how-to-find-the-bad-comma) shows how to find it.

A single object with no list around it is also accepted. It is treated as a list of one and gives one row. A list of plain values, such as `[1, 2, 3]`, gives one column called `value`.

## Which delimiter should you use?

| Delimiter | Use it when | Watch out for |
| --- | --- | --- |
| Comma | Most tools and most countries, including India | Values that contain commas get quoted automatically |
| Semicolon | Excel in countries where a comma is the decimal mark, much of Europe | Fine in text, but some tools expect commas |
| Tab | Pasting straight into a sheet, or loading into a database | Tabs inside values are rarer, but still get quoted |
| Pipe ( | ) | Data that is full of commas and semicolons | Fewer programs recognise it by default |

*Whatever you pick, values that contain the delimiter, a double quote or a line break are wrapped in quotes, and any quote inside is doubled.*

## Four Excel surprises after a perfect conversion

The CSV text is correct, you double-click it, and Excel “helps”. Most complaints about JSON-to-CSV tools are really complaints about how Excel opens CSV files.

**What Excel does on its own**

| Box | What it means |
| --- | --- |
| Strips leading zeros | A PIN like 012345 or a phone number starting with 0 becomes 12345. Import the column as Text. |
| Mangles long numbers | Numbers over 15 digits, such as a 16-digit card number, turn into scientific notation and lose digits. |
| Turns text into dates | Something like 1-2 or 3/4 can become a date. The original text is gone once you save. |
| Garbles Hindi and symbols | Opening by double-click may guess the wrong encoding. Import with UTF-8 selected. |

*None of this is the conversion’s fault. The cure is the same for all four: import the file instead of double-clicking it.*

1. Open a blank workbook in Excel.
2. Go to **Data**, then **From Text/CSV**, and pick your file.
3. Set the **file origin** to UTF-8 if the preview shows broken characters.
4. Choose the delimiter you used, then click **Transform Data** and set the problem columns, such as phone numbers and PIN codes, to **Text**.
5. Load the result.

If you would rather skip CSV completely, the [JSON to Excel Converter](https://toolcloak.com/tools/json-to-excel-converter) writes a spreadsheet file directly. For viewing only, the [JSON to Table](https://toolcloak.com/tools/json-to-table) tool shows the records on screen.

## Quick checks before you share the file

- **Compare the row count** with what you expected. The tool reports rows and columns right under the result.
- **Look at the header.** Dotted names such as `address.city` are normal. Rename them if the reader will see them.
- **Scan for long cells.** A cell holding a whole list is a sign that you pasted too much, or that the data has a list you may want to expand.
- **Think about privacy.** API data often holds emails and phone numbers. The conversion runs in your browser, so the JSON is not sent anywhere, but the CSV you save is as private as you keep it. A [password-protected PDF](https://toolcloak.com/articles/how-to-password-protect-a-pdf-free-aes-256-open-password-against-permissions-and-what-to-do-if-you-forget-it) is a safer way to share a printout.

## Frequently asked questions

### How do I convert JSON to CSV?

Open the JSON to CSV tool, paste a JSON array of objects, choose the delimiter and press Convert to CSV. Each object becomes a row and each key a column. The result shows the row and column counts.

### json ko csv mein kaise badle?

JSON to CSV tool kholiye, apna JSON array paste kijiye, delimiter chuniye (comma ya semicolon) aur Convert to CSV dabaiye. Har object ek row banega aur har key ek column. Result ko Excel mein Data, From Text/CSV se kholiye.

### How does the tool handle nested JSON?

Nested objects are flattened into columns named with dots, such as address.city. A list inside a record stays in a single cell as JSON text, so no extra rows are created.

### Why do I get only one row from my JSON?

You probably pasted an outer object like {"data": [...]}. The tool treats that as one record. Paste only the inner array, from the opening square bracket to its closing one, and each record becomes a row.

### Which delimiter should I choose for Excel?

A comma works for most setups, including India. If your Excel uses a comma as the decimal mark, as in much of Europe, pick a semicolon. You can also import the file with Data, From Text/CSV and choose the delimiter there.

### Why are my leading zeros missing in Excel?

Excel treats a value like 012345 as a number and drops the zero when you double-click the file. Import it with Data, From Text/CSV and set that column to Text. The CSV itself still holds the zero.

### Why does Hindi text look broken when I open the CSV?

Excel may guess the wrong encoding when you double-click. Import the file with Data, From Text/CSV, set the file origin to UTF-8, and the characters should appear correctly.

### Is it safe to convert JSON online?

It is safest when the data stays on your device. The JSON to CSV tool runs in your browser, so what you paste is not uploaded.

