JSON Flattener
Turn a nested document into one level of paths and values for a config file or a spreadsheet, and turn it back again.
Nested
Syntax colouring is off for this document because recolouring something this large on every keystroke would slow typing down. Every tool still works normally.
Flat
Syntax colouring is off for this document because recolouring something this large on every keystroke would slow typing down. Every tool still works normally.
The result appears here.
Runs entirely in your browser. Nothing you paste is uploaded, and you can confirm that in your browser Network tab.
About this tool
Flattening is what a document needs before it meets something that has no nesting: an environment file, a spreadsheet column, a translation catalogue, a form of key and value pairs. There is no standard for how the path is written, so the three spellings people actually use are offered and the page says which one is in force rather than picking one quietly. Two things really are ambiguous and both are handled in the open. A key that already contains the separator would produce a path nobody could read back, so it is refused by name with the suggestion to pick another style. Going the other way, a path segment made only of digits could mean an array index or an object key, and nothing in a flattened document says which, so that is a toggle. Empty objects and arrays are kept as values of their own, otherwise they vanish and the document does not survive the round trip.
How to use
- Choose a direction, then paste your document into the left pane or load the sample.
- Pick the path style. It has to match the document you are reading back.
- Press Convert, then copy the result or download it.