JSON Flatten & Unflatten

Flatten nested JSON into dot/bracket key paths and rebuild it back, with a live two-way preview — runs 100% in your browser with no upload.

🔒 Flattened and rebuilt entirely in your browser — nothing is uploaded.

Flatten and unflatten JSON in your browser

Paste a nested JSON object and instantly see it collapsed into a single-level map of path keys and values. Object properties are joined with dots and array items use bracket indices, so {"a":{"b":1},"c":[2,3]} becomes {"a.b":1,"c[0]":2,"c[1]":3}. The two panels stay in sync: edit either the nested JSON or the flattened JSON and the other side is recomputed live, then copy whichever result you need with one click.

Lossless, predictable round-trips

Flattening and unflattening are exact inverses of each other. Numbers, booleans, strings and null are preserved as-is, and empty objects and arrays are kept as leaf values so nothing silently disappears. Numeric path segments rebuild arrays while named segments rebuild objects, meaning any structure you flatten can be reconstructed byte-for-byte. This makes the tool handy for diffing config files, building form field names, or preparing flat key/value data for spreadsheets and environment files.

Frequently asked questions

Is my JSON uploaded anywhere?

No. The entire flatten and unflatten process runs locally in your browser with JavaScript. Your JSON never leaves your device and nothing is sent to a server, so even sensitive payloads stay completely private.

How are arrays represented in the flattened keys?

Array items use bracket indices appended to the key, like c[0] and c[1]. Nested arrays stack their indices, so a value at m[1][0] means the first element of the second inner array. Unflattening turns any numeric segment back into a real array.

Can I edit either side and convert both ways?

Yes. The tool is fully two-way: type or paste into the Nested JSON box to flatten it, or edit the Flattened JSON box to rebuild the nested structure. If a side is not valid JSON an inline message appears and the other side simply waits until the input parses.