Convert nested JSON to CSV by flattening multi-level objects
Convert nested JSON to CSV by transforming deeply hierarchical objects into flat, organized table columns. While spreadsheets require two-dimensional rows and columns, real-world data from APIs, databases, and microservices often contains objects inside objects. mommyfile bridges this gap with customizable, automated flattening algorithms.
Predictable Column Naming
By default, mommyfile concatenates nested object property names using dot notation (parent.child). This preserves relational context while creating unique, clean column headers.
How to convert nested JSON to CSV using dot notation
Flattening nested data requires zero manual scripting or complex command-line syntax:
Paste or upload nested JSON
Drop your multi-level JSON file or paste the raw payload containing nested objects and child dictionaries into the input area.
Select flattening separator and array mode
Choose your separator character (., _, or /) and select how child arrays should be represented (indexed columns, joined strings, or stringified JSON).
Preview column headers and export
Review the flattened columns in the live monospace preview table and download your finished CSV spreadsheet.
How nested key separators and array expansion work
When converting hierarchical data to flat tables, two primary structures require transformation:
- Child Objects: An object located at
customer.billing.cityis unwrapped into a dedicated column namedcustomer.billing.city. Every row with this structure populates its corresponding cell, while rows without it leave the cell blank. - Child Arrays: Lists of items can be handled in three ways depending on your analysis goals:
- Index Expansion (Default): Generates distinct columns for each array element (
tags.0,tags.1). - Delimited Join: Merges primitive array elements into a single cell separated by semicolons (
tag1; tag2; tag3). - JSON Stringify: Preserves the raw array notation (
["tag1", "tag2"]) within a single escaped cell.
- Index Expansion (Default): Generates distinct columns for each array element (
Flattening nested JSON vs Python pandas json_normalize
Many developers resort to writing custom Python scripts using pandas.json_normalize() to flatten nested payloads. While powerful, writing boilerplate Python scripts for ad-hoc datasets is time-consuming and requires installing local runtime environments.
mommyfile provides the same structural normalization as json_normalize, including recursive object unnesting, missing key tolerance, and array strategies, directly inside your browser with immediate visual feedback.