File conversion

How to convert nested JSON to CSV

See exactly how nested objects and arrays become CSV columns, using a real API record. Free JSON to CSV converter that runs in your browser, no upload.

DealMahal team · Published 6 December 2026 · 5 min read

A CSV is flat: one row per record, one value per cell. Nested JSON has objects inside objects and lists inside records. To convert it, every nested field needs its own column, and every list needs a rule. Our free JSON to CSV converter applies these rules automatically: nested fields become dotted column names such as seniorityMix.senior, lists of plain values are joined with semicolons, and lists of objects are kept as JSON text so nothing is lost.

Below is a real record and exactly what it turns into.

A real nested record

This is part of a real company hiring report from our own jobs API, generated on 4 December 2026:

[
  {
    "recordType": "company_report",
    "companyName": "OpenAI",
    "openRoles": 885,
    "postedLast30Days": 314,
    "topDepartments": [
      { "name": "Go To Market", "openRoles": 232 },
      { "name": "Applied AI", "openRoles": 123 }
    ],
    "seniorityMix": { "mid": 517, "manager": 134, "senior": 15 },
    "exampleTitles": [
      "Hardware Design Engineer, AI for Chip Design",
      "Site Selection Lead"
    ]
  }
]

It has all three shapes you meet in practice: plain fields, a nested object (seniorityMix), a list of plain values (exampleTitles) and a list of objects (topDepartments).

What the converter produces

ColumnValue
recordTypecompany_report
companyNameOpenAI
openRoles885
postedLast30Days314
topDepartments[{"name":"Go To Market","openRoles":232},{"name":"Applied AI","openRoles":123}]
seniorityMix.mid517
seniorityMix.manager134
seniorityMix.senior15
exampleTitlesHardware Design Engineer, AI for Chip Design; Site Selection Lead

The rules, in full:

  1. Nested objects are flattened with dots. seniorityMix becomes three columns. Objects inside objects keep going: a.b.c. Past 20 levels deep, the rest is kept as JSON text.
  2. Lists of plain values are joined with ; (semicolon and space) into one cell.
  3. Lists that contain objects are kept as compact JSON in one cell. We do not explode them into extra rows, because that would repeat every other field and make counts wrong.
  4. Empty objects become an empty cell.
  5. Records with different fields are fine. Columns are the union of every field, in the order they first appear. A record that lacks a field gets an empty cell.
  6. Booleans and null come through as text (true, false, and an empty cell for null).

Step by step

  1. Open JSON to CSV.
  2. Choose or drop a .json, .jsonl or .txt file up to 50 MB, or paste the JSON into the box.
  3. Check the column names in the preview (first 100 rows).
  4. Download CSV, Excel or flattened JSON.

If you choose Excel, the option "Save numbers as numbers" turns values like 885 into real numbers, while codes that start with 0 and values of 16 or more characters stay as text.

Shapes of input it understands

Your file looks likeWhat happens
[ {...}, {...} ]One row per object
{"data": [ {...}, {...} ], "meta": {...}}Uses the largest list of objects inside (data here)
One object per line (JSON Lines, NDJSON)One row per line
[ [1, "a"], [2, "b"] ] (list of lists)First inner list becomes the header row
A single object with no lists of objects insideOne row

One gotcha: a single object that contains a list of objects, like one company report on its own, is treated as a wrapper, and the converter uses that inner list (here, topDepartments) as the records. To convert the outer object as one row, wrap it in square brackets: [ {...} ].

If the converter shows an error

Valid JSON puts double quotes around names and text, and allows no trailing commas and no comments. That comes from the JSON standard itself (RFC 8259), and exports edited by hand often break it.

Message or symptomLikely causeFix
"This is not valid JSON or JSON Lines. There is a problem on line 1."A normal JSON file (starting with [ or {) with a syntax error somewhere, such as a trailing comma or single quotesOpen it in a code editor, which marks the exact spot, fix it and convert again
The same message with a higher line numberA JSON Lines file where that line is not validFix or delete that line
"This is not valid JSON."A one-line file with a syntax errorSame fix as the first row
"The limit is 2,000 columns"Objects keyed by IDs or dates, so every record adds new keysConvert a smaller part, or reshape the data into a list of records first
Far fewer rows than you expectedA single object holding several lists; the largest list of objects was usedWrap the part you want in square brackets and convert that

When to explode arrays into rows instead

Sometimes you do want one row per array item, for example one row per department. Do it in two passes:

  1. Convert once to get the main table.
  2. Copy the topDepartments cell contents into a new file, wrap them in [ ], and convert that file. You now have a department table: name and openRoles.

For repeated work, this is a job for a script (for example pandas json_normalize in Python). For one-off files, two passes in the browser is faster.

Going back the other way

To turn a CSV back into JSON, use CSV to JSON. Each row becomes an object keyed by the header row. It does not rebuild nesting from dotted names, so seniorityMix.mid stays a key with a dot in it.

Where the example came from

The record above comes from our hiring data API, which returns one company report per employer (open roles, recent postings, departments, seniority mix). If you build tools on top of job data, see the jobs API and MCP server.

Frequently asked questions

How are nested objects turned into columns?

Each nested field gets its own column, named with dots for each level. For example {"address": {"city": "Pune"}} becomes a column called address.city with the value Pune.

What happens to arrays?

A list of plain values, like tags, is joined into one cell with a semicolon and a space. A list that contains objects is kept as JSON text in one cell, so no data is lost.

Does it read JSON Lines (NDJSON)?

Yes. If the file is not a single JSON document, it is read one line at a time, with one record per line.

My API response wraps the records in an object. Do I need to unwrap it?

Usually not. If the top level is an object, the converter uses the largest list of records it finds inside it, such as data or results.

Is my JSON uploaded?

No. It is read in your web browser, so API responses and logs never leave your computer.

Spotted an error? Write to dealmahal.official@gmail.com.

Questions or corrections: dealmahal.official@gmail.com.

Keep reading

All posts