Skip to main content

JSON conversion problem

Convert Nested JSON to CSV Without Losing Structure

Choose a flattening rule for nested objects and arrays before converting JSON records into a tabular CSV.

Use the matching tool

JSON to CSV

Open JSON to CSV

What the error actually means

CSV is a flat table while JSON can contain nested objects and arrays. Conversion therefore requires a policy: flatten object paths, serialize nested values, expand arrays into rows or split related entities into separate tables.

Likely causes

  • Records contain nested address or metadata objects.
  • Arrays have different lengths.
  • Objects do not share one schema.
  • The desired row grain was never defined.

Flattening choice

Problem

{user:{name:"Ada"},orders:[1,2]} with no rule

Correct pattern

user.name as a column and orders handled by an explicit expansion or serialization policy

A safe repair workflow

  1. 1Validate the JSON.
  2. 2Define what one CSV row represents.
  3. 3Choose how objects and arrays should flatten.
  4. 4Compare record and expanded-row counts.

How to verify the result

A file that downloads successfully is not automatically a correct file. Check the result at both the structural and business-data levels:

  • Required nested fields are present.
  • Arrays did not overwrite values.
  • Null and absent fields remain distinguishable where needed.
  • Output rows follow the chosen grain.

Read the deeper guides