Converters Nested JSON ⇄ CSV (Flatten)

Nested JSON ⇄ CSV (Flatten)

Flatten nested JSON objects and arrays into flat CSV columns like address.city, or rebuild nested JSON from a flat CSV. Supports files up to 200MB.

Or convert a file directly — supports files up to 200MB

Drag & drop a file here, or click to browse

Processed in the background, so the page stays responsive even for huge files

How to use this tool

Paste nested JSON with JSON → Flat CSV selected to get one row per record and one dotted column per nested field. Edit the CSV in a spreadsheet, then switch to CSV → Nested JSON and paste it back to rebuild the structure. Files over 5 MB are converted in the background, up to 200 MB.

Worked example: a product catalogue

[
  { "sku": "K-102", "price": { "mrp": 1299, "sale": 999 },
    "sizes": ["S", "M", "L"], "stock": { "2025": 40, "2026": 12 } },
  { "sku": "K-205", "price": { "mrp": 899, "sale": 899 },
    "sizes": ["M"], "stock": { "2026": 7 } }
]
sku,price.mrp,price.sale,sizes.0,sizes.1,sizes.2,stock.2025,stock.2026
K-102,1299,999,S,M,L,40,12
K-205,899,899,M,,,,7

Converting back rebuilds K-102 exactly. K-205 gets its single size back as ["M"], because empty cells under numbered columns are skipped, but its stock comes back as {"2025": "", "2026": 7}: an empty cell under an ordinary key is kept as an empty string. The year keys stay object keys. Numbered segments only become an array when they start at 0, as sizes.0 does, so stock.2025 doesn't turn into an array with two thousand empty slots.

Editing the sheet before converting back

  • New field: add a column such as price.gst and it appears inside price on every record, as "" where you left it blank.
  • New array item: add sizes.3 after sizes.2. Filling it for K-102 gives four sizes.
  • Removing an item: clearing sizes.1 while sizes.2 is still filled leaves a gap, which comes back as ["S", null, "L"]. Move the later values left instead.
  • Renaming a header changes the structure: price.sale renamed to offer.price moves the value into a new offer object.

Frequently Asked Questions

Why does an array field become "hobbies.0", "hobbies.1" instead of one column?

CSV columns hold single values, not lists, so an array needs to be split across multiple numbered columns to fit the format — hobbies.0 for the first item, hobbies.1 for the second, and so on. When converting back to JSON, those numbered columns are reassembled into an array in the same order, so the round trip preserves the original structure.

What if an object really does use the keys "0", "1", "2"?

It comes back as an array. A flat header like data.0 looks the same whether it came from ["a"] or from {"0": "a"}, and the converter reads numbered keys that start at 0 as array positions. Keys that don't start at 0, such as years or PIN codes, stay object keys.

Do numbers and true/false survive the round trip?

Plain numbers and booleans do: 1299 comes back as a number and true as a boolean. Text that only looks numeric stays text, so a zip code like 073301 keeps its leading zero and a 16-digit card or order number is not rounded. The catch is the reverse case: a value that was the string "1299" in your JSON comes back as the number 1299, because the CSV cell doesn't record which it was.

Related Tools

Related Blog Posts