How to Convert a JSON Array to an Object
Input Your JSON Array
Start by providing your JSON array data. The converter accepts arrays with exactly one object element. You can:
Example: JSON Array Input
Here's what a JSON array looks like:
[ { "name": "Sarah Chen", "email": "[email protected]", "age": 20, "major": "Computer Science", "gpa": 3.8, "enrollmentYear": 2022 } ]
Automatic Conversion
There is no Convert button. About half a second after you stop typing, the page:
Example: Converted Object Output
The same data, now as a JSON object (brackets removed):
{ "name": "Sarah Chen", "email": "[email protected]", "age": 20, "major": "Computer Science", "gpa": 3.8, "enrollmentYear": 2022 }
Export Your Converted Object
Once the object is in the output, you can take it with you in a couple of ways:
Frequently Asked Questions
What does this converter actually do?
It takes an array with exactly one object in it, like [{"id": 1}], and gives you the object on its own: {"id": 1}. Nothing inside the object is touched. The outer square brackets go away and the result is re-indented with two spaces (or squeezed onto one line if you click Minify).
Can I convert an array with several objects?
No. Several objects can't turn into one object without throwing data away or making up keys, so the page stops and tells you how many items it found. Delete the items you don't need first, or use JSON Splitter if you want to break a long array into smaller pieces.
Why would an API give me an array with just one object?
It happens a lot: search endpoints, SQL query results and some GraphQL or REST wrappers always return a list, even when you asked for a single record by ID. If your code or a config file expects the object itself, unwrapping it here saves you editing the brackets by hand and accidentally cutting a comma.
Will any of my values change?
No. The object is copied from your input as text, so 8901240544102066246 keeps every digit, 14.50 keeps its trailing zero, 1e21 and escapes like \u0041 stay as written, and keys stay in the order you typed them. If the same key appears twice in the object, both copies are kept and a note under the output names the key, because most JSON readers would only keep the last one.
What if I paste a plain object or broken JSON?
A plain object is already what this page produces, so you get a short message and a link to JSON Object to Array, which does the opposite. Broken JSON shows the line and column of the first problem with a plain explanation, for example a trailing comma or a missing quote, so you can fix it in the editor.
Is my JSON uploaded anywhere?
No. The conversion runs in your browser and nothing you paste or upload is sent to our server or kept. Reload the page and the editor starts empty again.
Related pages: JSON Object to Array does the reverse, JSON Splitter breaks long arrays up, and JSON Validator checks any JSON for syntax errors.