All tools

Flatten / Unflatten JSON

JSON

Flatten deeply nested JSON to dot-notation keys, or unflatten a flat object back into nested structure.

Finding which nested path holds a specific value in a large, deeply nested API response is much easier once every value is a single dot-notation key rather than buried three levels deep, and this flattens a JSON object to exactly that, useful for spreadsheet export or diffing, and unflattens the other direction to turn a flat object (like one exported from analytics or CSV) back into proper nested JSON. Array items become indexed keys such as `items.0.name`, which round-trips correctly back to an array as long as the keys stay sequential and untouched. That guarantee holds for output this tool produced, but flattened data from another source with ambiguous keys (literal dots inside a key name, for instance) can produce unexpected nesting on unflatten. It handles typical API-response-sized JSON fine; extremely large or deeply nested objects may be slow since everything runs in the browser.

jsonflattenunflattennesteddot-notationtransform

How to use Flatten / Unflatten JSON

  • 1.Paste a deeply nested JSON object and flatten it to see every value as a single dot-notation key, useful for spreadsheet export or diffing.
  • 2.Take a flat, dot-notation object (like one exported from analytics or a CSV) and unflatten it back into proper nested JSON.
  • 3.Use flattening to quickly spot which nested path holds a specific value in a large, deeply nested API response.

Frequently asked questions

Does this run in my browser or on a server?
Flattening and unflattening both run entirely client-side — no data is uploaded.
How are arrays handled when flattening?
Array items become indexed keys (e.g. `items.0.name`), which round-trips correctly back to an array on unflatten as long as the keys are sequential and untouched.
Does unflatten always perfectly reverse a flatten?
Yes for output produced by this tool, but if you're unflattening dot-notation keys from another source, ambiguous keys (like keys containing literal dots) can produce unexpected nesting.
Is there a size limit?
It handles typical API-response-sized JSON fine; extremely large or deeply nested objects may be slow since processing happens in the browser.

Use via API, SDK, or MCP

cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/flatten-json \
  -H "Authorization: Bearer utx_live_..." \
  -H "Content-Type: application/json" \
  -d '{"json":{"user":{"name":"Alice","address":{"city":"NYC"}}},"separator":".","unflatten":false}'

Get an API key from your dashboard · Full API docs →