Flatten Nested JSON to Single Level Online

Overview

Database columns and CSV rows are flat. Nested JSON with multiple levels of objects needs to be flattened before it can be imported into a SQL table, a spreadsheet, or a key-value store. This tool collapses all nesting using dot notation: {a:{b:1}} becomes {a.b:1}.

How to Use This Tool

Paste your nested JSON and click Flatten. The tool produces a single-level object where each key is the full dot-notation path to the original value. Arrays are indexed as key.0, key.1, etc.

Ready to get started? It's free, no registration required, and your files never leave your device.

PDF Tool

Frequently Asked Questions

What delimiter is used between nested keys?

The default delimiter is a dot (.). You can switch to underscore or slash via the Delimiter option if your keys already contain dots.

How are arrays handled when flattening?

Array items are indexed numerically. An array [{name:'A'},{name:'B'}] under key items becomes items.0.name and items.1.name as separate flat keys.

Can I unflatten a flat JSON back to nested?

Yes. The tool supports both flatten and unflatten operations. Paste your dot-notation flat JSON and click Unflatten to reconstruct the nested structure.