What does the JSON Flatten & Unflatten do?
Flattening turns nested JSON into a single level of keys, so {"customer":{"city":"Pune"}} becomes {"customer.city":"Pune"}. Unflattening reverses it. Flat keys are easier to put in a table, a spreadsheet, environment variables or a key-value store.
How to use the JSON Flatten & Unflatten
- Choose Flatten or Unflatten.
- Paste your JSON. The result appears as you type.
- Pick the separator (dot, underscore or slash) and how arrays are written.
- Switch to the Table view to read keys and values side by side, then copy the result.
When it helps
- Preparing nested data for a spreadsheet or a database
- Creating flat configuration keys
- Comparing deeply nested documents key by key
Frequently asked questions
How do I flatten nested JSON?
Paste it into the tool with Flatten selected. Each nested value gets a key made from its path, such as order.items[0].sku.
Can I choose the separator?
Yes. Use a dot, underscore or slash, and write arrays as items[0] or items.0.
How does unflatten decide between arrays and objects?
Keys written as [0] or a plain number segment become array positions. Everything else becomes an object key.
What happens to empty objects and arrays?
You can keep them as {} and [] values or leave them out. Keeping them lets unflatten rebuild the original exactly.