Skip to content
hateitall

JSON Flatten

Turn deeply nested JSON into simple key and value pairs for spreadsheets, translation files or environment settings.

Processed locallyIn: JSONOut: JSON

Loading tool…

How to use json flatten

  1. Paste nested JSON or open a file.

  2. Choose the separator, such as a dot, underscore or slash.

  3. Pick .0 or [0] for array positions and whether to keep empty objects.

  4. Copy or download the flat JSON.

What this tool does

  • Any separator, including multi-character ones like __ for environment variable style keys.
  • Arrays as user.roles.0 or user.roles[0].
  • Keeps empty {} and [] as values so nothing disappears silently.
  • Warns when an original key already contains the separator, which would make the result ambiguous.

How the result is verified

The flat result is unflattened again and compared with your original JSON. The tick only shows when the round trip is exact.

Frequently asked questions

Can I get the nested JSON back?

Yes. Switch to Unflatten and the flat output becomes the input. With empty objects kept and no separator inside your keys, the round trip is exact.

What separator should I use for environment variables?

Use a double underscore (__), which many config libraries read as a nesting marker, and turn on [0] style only if your loader expects it.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Dot path keys back to nested objects and arrays

JSON→ JSONLight on device

Flatten JSON arrays into spreadsheet rows with dot path columns

JSON→ CSVLight on device

Beautify or minify JSON with your choice of indentation

JSON→ JSONLight on device

Live JSONPath queries with filters, slices and match paths

JSON · JSONPath→ JSONLight on device

Collapsible, searchable tree view that stays fast on large files

JSON→ PathLight on device