{ }jsonkit
Tools/Format/JSON Flattener
Search tools…⌘K
Format
{ }JSON Formatter
≡→JSON Minifier
\"JSON Escape / Unescape
a→zJSON Sorter
⇄{}JSON Flattener
Validate
JSON Validator
±JSON Diff / Compare
§JSON Schema Generator
JWT Decoder
ΔJSON Patch / Merge Patch
kbJSON Size Analyzer
Convert
→csvJSON to CSV
csv→CSV to JSON
⇄ymlJSON ⇄ YAML
⇄xmlJSON ⇄ XML
→tsJSON to TypeScript
b64Base64 Encode / Decode
%2FURL Encode / Decode
clkTimestamp Converter
→zJSON to Zod
→pyJSON to Pydantic
→goJSON to Go
→javaJSON to Java
⇄jsonlJSON ⇄ JSONL
5→JSON5 / JSONC to JSON
Query
$.JSONPath / JQ Tester
.*Regex Tester
Generate
Mock JSON Data Generator
idUUID / NanoID Generator
#Hash Generator
⇄{}

JSON Flattener & Unflattener

Flatten nested JSON to dot-path keys, or expand it back.
processes as you type · client-side
Sample
Upload
⇄ Flatten
⧉ Copy output ⌘C
Download
Share
Clear
Nested JSON219 B · paste or drop a file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Flat JSON
codetree
1 2 3 4 5 6 7 8 9 10 11
{ "id": "usr_8x42", "name": "Ada Lovelace", "email": "ada@example.com", "active": true, "roles[0]": "admin", "roles[1]": "editor", "plan.tier": "pro", "plan.seats": 5, "plan.renews": "2026-08-01" }
✓ valid (RFC 8259)219 B → 215 B0.0 msLn 1, Col 1UTF-8

About JSON Flattener

The JSON flattener collapses a nested JSON document into a single-level object whose keys are dot-notation paths, like "plan.tier" and "roles[0]". It is the fastest way to turn deeply nested data into a flat map you can diff, feed into a spreadsheet, or store as key/value pairs.

It runs entirely in your browser — nothing you paste is uploaded, logged or sent to a server, so flattening a real production payload is completely private. It is free, instant and needs no account.

Flip the direction and it unflattens: given a flat object of dot-and-bracket paths it rebuilds the original nested objects and arrays. The two directions are exact inverses, so you can round-trip a document out to a flat form and back without losing structure.

How it works

Dot paths and bracket indices

Object keys are joined with dots (plan.tier) and array elements use bracket indices (roles[0]). Using brackets for arrays rather than dots is what lets the unflattener tell an array index apart from an object key, so the reverse operation reconstructs arrays correctly.

Empty objects and arrays are preserved

An empty object {} or empty array [] has no leaf values to flatten, so it is kept as a value at its own path. This means empty containers survive the round trip instead of silently disappearing when you unflatten.

Unflatten rebuilds the structure

The swap control flips to unflatten mode: paste a flat object of path keys and it rebuilds the nested objects and arrays. Numeric bracket segments become array positions and dotted segments become object keys, reproducing the original document.

Pretty-printed both ways

Both directions output pretty-printed JSON with two-space indentation, so the result is readable and ready to copy. Values — strings, numbers, booleans and null — are preserved exactly; only the shape of the keys changes.

Frequently asked questions

What is flattened JSON?

Flattened JSON is a single-level object where each key is the full path to a value in the original nested document, for example "plan.tier": "pro" and "roles[0]": "admin". It represents the same data as a flat map of path/value pairs, which is easier to diff, export to CSV, or store as key/value settings.

How to flatten nested JSON to dot notation?

Paste your nested JSON and the tool walks every branch, joining object keys with dots and indexing array elements with brackets, producing a single-level object. It happens instantly in your browser as you type — nothing is uploaded.

Can I unflatten it back to nested JSON?

Yes. Use the swap control to switch to unflatten mode and paste a flat object of dot-and-bracket path keys; the tool rebuilds the original nested objects and arrays. Flatten and unflatten are exact inverses for well-formed input.

What happens to keys that already contain a dot?

Dots are the path separator, so a key that itself contains a dot is treated as two path segments — the operation is lossy for such keys and unflattening will split them into nested keys. If your data has literal dots in key names, flattening is not round-trip safe for those keys.

Is my data uploaded anywhere?

No. Both flattening and unflattening run locally in your browser with JavaScript. Your JSON is never sent to a server, so it is safe for production payloads, and it keeps working offline.