jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

JSON Array ↔ Object

key by field · group by · entries · back to array · updated 28 July 2026

Reshape between arrays and objects. Turn an array of records into a lookup object keyed by id, group records by a shared field, index by position — or go the other way and expand an object back into an array, with the key folded in as a field.

Paste input to start.

How to reshape a JSON array into an object

  1. Paste your JSON — an array for the first three modes, an object for the last three.
  2. Pick a Direction.
  3. For keying and grouping, set the Key field name. Dotted paths work, so user.id is fine.
  4. Tick Remove the key field if it would be redundant once it is the object key.
  5. Copy or download the reshaped JSON.

Which mode do I want?

Privacy

Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.

FAQ

What happens to records missing the key field?

They are kept under a generated __missing_N key so nothing is silently dropped, and the status bar counts them. Find them first with Filter array and id missing.

Will duplicate keys lose data?

In key by mode, yes — the last record with that key wins. Use group by instead to keep every record, or dedupe first to decide deliberately which one survives.

Are numeric keys turned back into numbers?

In Object → array mode, yes — a key like "42" becomes the number 42 in the folded-in field, since JSON object keys are always strings but the original value probably was not.