JSON Flatten & Unflatten
Flatten nested JSON into simple dot notation keys — free, private and running entirely in your browser
Flatten nested JSON into delimiter-joined keys, or Unflatten flat keys back into objects and arrays. Default delimiter is a dot. Optional Rebuild arrays from numeric keys.
Guide, examples, and FAQ
About JSON Flatten
What it does
In Flatten, walks objects and arrays; arrays use numeric path segments (tags.0). Empty objects become {} at that key; empty arrays become []. Leaf scalars are written under the joined path. If two paths write the same key, the first value is kept and a warning lists the key. Keys that already contain the delimiter are not escaped. In Unflatten, keys are split on the delimiter; with Rebuild arrays from numeric keys on, contiguous 0…n-1 key sets become arrays; off, they stay objects with string keys. A blank Delimiter is treated as a dot.
Who it is for
People mapping nested API payloads to flat maps (or the reverse) for configs or stores that only hold flat keys.
When to use it
When you need exact delimiter paths and a reversible unflatten with optional array rebuild.
Key features
Flatten / Unflatten
Toggle mode. Output pane labeled Flattened or Nested.
Delimiter
Default is a dot. A blank value is treated as a dot.
Rebuild arrays from numeric keys
Switch (default on). Applies in Unflatten when keys are contiguous 0…n-1.
Status and download
Ready, Awaiting input, a parse error, or a collision warning. Download saves flat.json or unflattened.json.
How to use JSON Flatten
- 1Choose Flatten or Unflatten.
- 2Set Delimiter if you do not want a dot.
- 3For Unflatten, set Rebuild arrays from numeric keys.
- 4Paste into JSON and wait for the output to update.
- 5Copy the Flattened or Nested output, or download the matching file name.
Example
Before
{
"user": { "name": "Ada", "address": { "city": "London" } },
"tags": ["admin", "editor"]
}After
{
"user.name": "Ada",
"user.address.city": "London",
"tags.0": "admin",
"tags.1": "editor"
}Empty containers { "a": {}, "b": [] } → { "a": {}, "b": [] }. Key with a dot: { "a.b": 1, "c": { "d": 2 } } → { "a.b": 1, "c.d": 2 } (no escaping). Collision warning: Key "a.b" comes from more than one path. The first value was kept. Unflatten {"tags.0":"admin","tags.1":"editor"} with rebuild on → {"tags":["admin","editor"]}; rebuild off → {"tags":{"0":"admin","1":"editor"}}.
Common problems and fixes
Parse error on the output status
Input is not valid JSON. Exact wording varies by browser. If no message is available, the status shows Invalid JSON.
Key "…" comes from more than one path. The first value was kept.
A nested path and a literal key share the same flattened key. Rename a key or change Delimiter.
Arrays stay objects after Unflatten
Turn Rebuild arrays from numeric keys on. Keys must be contiguous 0…n-1.
Benefits
Save time
What used to take a script or a desktop app now takes seconds — flatten nested JSON into simple dot notation keys the moment the page loads.
Stay private
Nothing is uploaded. JSON Flatten runs client-side, which keeps confidential nested JSON into simple dot notation keys on your own machine.
Get accurate output
Deterministic processing and clear error reporting mean the result you see is the result you ship.
Work anywhere
Once the page has loaded, JSON Flatten runs in the browser on desktop or mobile. Reloading the page needs a connection.
Common use cases
Backend developers
Inspect and clean up nested JSON into simple dot notation keys returned by an API before wiring it into a service.
Frontend developers
Prepare fixtures and mock nested JSON into simple dot notation keys for components without leaving the browser.
QA engineers
Reproduce a defect by checking the exact nested JSON into simple dot notation keys a failing request produced.
Data analysts
Reshape exported nested JSON into simple dot notation keys into a structure a spreadsheet or notebook can read.
DevOps engineers
Sanity-check configuration nested JSON into simple dot notation keys before rolling a change out to production.
Students
Learn how nested JSON into simple dot notation keys is structured with immediate, visual feedback while experimenting.
Tips & best practices
- Keep a small sample of your nested JSON into simple dot notation keys handy — testing the options on a short input is faster than reworking a large one.
- Use the copy and download actions instead of selecting text manually; they preserve formatting exactly.
- Bookmark JSON Flatten so the workspace is one keystroke away during your next session.
- Format nested JSON into simple dot notation keys before diffing or committing it — consistent formatting keeps reviews focused on real changes.
- Use JSON Flatten alongside your editor: paste, transform, copy back, and skip writing a throwaway script.
Common mistakes to avoid
- Pasting partial nested JSON into simple dot notation keys and assuming the result is wrong — always include the full input.
- Ignoring the status messages in the workspace; they explain exactly what went wrong and where.
- Uploading sensitive nested JSON into simple dot notation keys to random online services — JSON Flatten never needs to, because it runs on your device.
- Copying nested JSON into simple dot notation keys out of a terminal with wrapped lines, which silently corrupts the input.
- Trusting a transformed result without re-validating it once more before shipping.
Frequently asked questions
How are array indexes written when Flattening?
As numeric segments in the path, for example tags.0 and tags.1.
What happens to empty objects and empty arrays?
They are kept as {} or [] under that key instead of being omitted.
Are dots inside key names escaped?
No. A key a.b flattens to the literal key a.b, which can collide with nested a → b.
What does Rebuild arrays from numeric keys require?
Object keys that are all decimal digits, contiguous from 0 through n-1, with no gaps.
Is my data uploaded or stored?
Nothing is uploaded. Processing runs in your browser. Your input is kept only while this tab stays open and is cleared when you reload or close the tab.
Conclusion
JSON Flatten gives you a fast, private and dependable way to flatten nested JSON into simple dot notation keys without installing anything. Because every calculation and conversion happens in your browser, you get instant results while your nested JSON into simple dot notation keys stays on your machine. Try it above, then explore the rest of TheToolSera's developer tools to complete the next step in your workflow.
Ready to try JSON Flatten?
Scroll back up to start now, or continue with another free developer tool.