🔧

Unflatten JSON

POST /v1/convert/unflatten-json
curl -X POST "https://convert.toolkitapi.io/v1/convert/unflatten-json" \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"json": {"user.name": "Alice", "user.address.city": "NYC"}}'
# See curl example
// See curl example
Response 200 OK
{
  "json": {
    "user": {
      "name": "Alice",
      "address": {
        "city": "NYC"
      }
    }
  },
  "key_count": 2
}

How to Use

1

Send a POST request to /v1/convert/unflatten-json with a flat json object and optional separator.

About This Tool

Unflatten a dot-notation key-value object back into a nested JSON structure. The inverse of the flatten endpoint.

Handles dot-separated keys and bracket-notation array indices. For example, {"a.b[0]": 1} becomes {"a": {"b": [1]}}.

Why Use This Tool

Frequently Asked Questions

Are arrays reconstructed?
Yes — bracket indices (key[0], key[1]) are detected and converted back into JSON arrays.
What if keys conflict?
If a key is used as both a value and a prefix (e.g., 'a' and 'a.b'), the nested structure takes priority.

Start using Unflatten JSON now

Get your free API key and make your first request in under a minute.