Developer Tools

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.

By the Toolcloak team23 October 20266 min read
In this article
  1. The basic conversion
  2. What happens to nested data
  3. Lists inside records stay in one cell
  4. The wrapper object trap
  5. Which delimiter should you use?
  6. Four Excel surprises after a perfect conversion
  7. Quick checks before you share the file

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.

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 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.
Paste a JSON array, choose a delimiter, and press Convert to CSV.Open JSON to CSV

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

JSONCSV 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 JSONColumn in the CSV
"id": 1id
"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
2RowsOne per customer
5Columnsid, name, address.city, address.pin, skills
EmptyFor missing keysThe second record has no pin and no skills
1 cellFor the skills listShown 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.

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 wrapper1 row
  • status and data become the columns
  • All your records sit in one cell as text
  • Looks like a conversion that “did not work”
Pasted as the inner arrayOne row per record
  • Start at the [ that opens the list
  • End at the matching ]
  • 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 will lay it out with indentation, and the JSON Path Finder helps locate it. A stray comma is another common cause of failure, and our guide on why your JSON will not parse 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?

DelimiterUse it whenWatch out for
CommaMost tools and most countries, including IndiaValues that contain commas get quoted automatically
SemicolonExcel in countries where a comma is the decimal mark, much of EuropeFine in text, but some tools expect commas
TabPasting straight into a sheet, or loading into a databaseTabs inside values are rarer, but still get quoted
Pipe ( | )Data that is full of commas and semicolonsFewer 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
Strips leading zerosA PIN like 012345 or a phone number starting with 0 becomes 12345. Import the column as Text.
Mangles long numbersNumbers over 15 digits, such as a 16-digit card number, turn into scientific notation and lose digits.
Turns text into datesSomething like 1-2 or 3/4 can become a date. The original text is gone once you save.
Garbles Hindi and symbolsOpening 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 writes a spreadsheet file directly. For viewing only, the 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 is a safer way to share a printout.

Questions people ask

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.