·6 min read

How to Convert Nested JSON to CSV (With Examples)

A practical guide to flattening nested JSON structures into CSV columns. Covers dot notation, stringify mode, and handling arrays.

What is nested JSON?

Nested JSON is JSON where values are themselves objects or arrays — creating a tree structure rather than a flat key-value map.

{
  "user": {
    "name": "Alice",
    "address": {
      "city": "London",
      "country": "UK"
    }
  },
  "active": true
}

Flat JSON tools struggle with this — they either skip the nested data or error out.

How JSONtoCSV.tools handles nested JSON

The converter automatically flattens nested objects using dot notation:

ColumnValue
user.nameAlice
user.address.cityLondon
user.address.countryUK
activetrue

Each level of nesting is joined with the separator character. You can change the separator to underscore or any other character in the Options tab.

Arrays inside JSON objects

When a key's value is an array, you have two options:

**Option 1: Index expansion** — each array item becomes its own column: `tags.0`, `tags.1`, `tags.2`

**Option 2: Expand arrays to text** — items are joined into one cell: `"typescript | react | nodejs"`

**Option 3: Stringify** — the array is stored as a JSON string: `["typescript","react","nodejs"]`

Tips for nested JSON conversion

  • Use dot notation for human-readable column names
  • Use underscore notation if your downstream tool can't handle dots in headers
  • Enable "Stringify nested" when you want to preserve nested structure for later parsing
  • Use "Include only" in the Options tab to cherry-pick specific nested fields

Try the converter

Free, private, browser-based. No sign-up required.

Convert JSON to CSV →