Skip to main content

JSON Flatten / Unflatten

Turn nested JSON into flat keys such as a.b.0 and rebuild it. Choose the separator and array style and limit the depth. Private.

More options

JSON

Stays in your browser

Result

The result appears here after you press Convert.

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to JSONPath Tester or JSON to CSV.

Free Online JSON Flatten / Unflatten

Flat key-value JSON is easier to put in a spreadsheet, a .properties file or an environment. This tool flattens nested JSON and rebuilds it from the flat form. It gives developers a quick browser-based way to solve a focused json flatten / unflatten task before moving the result into a project.

How to use JSON Flatten / Unflatten

Paste your code in the box on the left, or open a file, then press Convert. Choose Flatten or Unflatten, then the separator. Keys that already contain the separator are written in bracket form so nothing is lost.

Common mistakes

  • Using a separator that appears in your keys: choose another one.
  • Unflattening keys such as a.0 and expecting an object: numbers become array positions.

Frequently asked questions

Can I get the original back?
Yes, as long as you use the same separator and array style. Keys that contain the separator are written as ["a.b"] so they come back correctly.
What are conflicts?
If a key is both a value and a parent, such as a and a.b, the data cannot be rebuilt. The tool names the key.
What about empty objects?
They are kept by default so nothing disappears. Turn the option off to drop them.
Is my code uploaded anywhere?
No. The conversion runs in your browser and nothing you paste is sent to a server.
How do I use this json flatten / unflatten tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Data Generation & Utilities

View all Data Generation & Utilities tools →