Transform

Unnest deep JSON hierarchies into flat single-level key-value objects using dot notation

Transform deeply nested JSON objects into flat dot-notated key-value pairs.

🛡️ Your rows never leave your browser.
Why Onfyt: Recursively unwinds arbitrarily deep object hierarchies into clean dot-notated properties in a single pass.

Interactive Sample Data

iduser.nameuser.address.cityuser.address.geo.lat
1Grace KeruboNairobi-1.286389
2Peter NjorogeMombasa-4.043477

How this tool works

MongoDB, Firestore, and REST API responses pack related attributes into nested objects: a customer record might contain an address sub-object, which itself contains a coordinates sub-object holding latitude and longitude. Pandas, SQL COPY, and most BI connectors expect flat rows — one column per attribute. Flattening collapses the nested structure into dotted-path column names: address.city, address.coordinates.lat, address.coordinates.lng — one wide row per document, ready for import. While hierarchical JSON is natural for application code, tabular data tools (CSV, SQL databases, BigQuery, Excel, and pandas) require flat, two-dimensional structures with discrete columns. Trying to import nested objects into standard tabular loaders results in those columns being serialized as raw string blobs like '{"city":"Nairobi"}' that require complex JSON path parsing in SQL. DataFix traverses arbitrary JSON object graphs recursively and collapses them into a single-level object. It builds composite keys using standard dot notation (e.g. 'user.address.city') or custom separators (e.g. 'user_address_city'). Nested arrays can be indexed numerically (e.g. 'tags.0', 'tags.1') or unnested, transforming hierarchical JSON into clean flat records ready for immediate CSV conversion. Nested JSON documents containing sub-objects and arrays cannot be directly mapped into flat tabular formats like SQL tables or CSV spreadsheets. DataFix flattens deeply nested JSON structures into single-level objects using dot-notation keys (e.g. Collapsing deep hierarchies into dot-notation keys allows relational database loaders to ingest nested documents into flat tables.

Things that usually go wrong

  • Arrays inside objects (e.g. tags: ['a','b']) are joined as a comma-separated string, not expanded into separate columns.
  • Very deep nesting (10+ levels) produces very long column names.

Edge cases we tested

🧪 Nested arrays containing primitive values (['admin', 'editor'])

Indexed numerically ('roles.0', 'roles.1') or joined into a comma-separated string.

🧪 Null or empty nested objects ({'address': null})

Preserved cleanly as null properties without crashing the recursion.

🧪 Keys that already contain dots in their original names

Escaped or handled with alternative delimiter (e.g. underscore notation).

Frequently Asked Questions

What is the separator between nested keys?

A dot ('.'). So {'address': {'city': 'Nairobi'}} becomes a column named 'address.city'.

Can it handle arrays of objects?

Yes. The input should be a JSON array at the top level. Each object in the array becomes one row in the output.

Related tools

Transform

Column to Comma-Separated List

Extract a CSV column and convert it to a comma-separated list for SQL IN clauses or code arrays.

Open Tool →
Transform

Comma-Separated List to Column

Convert a comma-separated, line-separated, or SQL IN list into a single-column CSV.

Open Tool →
Transform

Lines to CSV

Convert plain-text newline-delimited records into structured CSV tables.

Open Tool →