Loading JSON Array to Object Converter...
Please wait a moment

How to Convert a JSON Array to an Object

Step 1

Input Your JSON Array

Start by providing your JSON array data. The converter accepts arrays with exactly one object element. You can:

•
Paste directly: Copy your JSON array and paste it into the input editor
•
Upload a file: Click "Upload" to select a .json or .txt file containing your array
•
Try the sample: Click "Sample" to load example data and see how the conversion works

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
  }
]
Step 2

Automatic Conversion

There is no Convert button. About half a second after you stop typing, the page:

•
Validates the array: Checks that input is a valid JSON array with exactly one object
•
Removes brackets: Extracts the object from the array by removing the outer brackets
•
Re-indents the object: Lays it out with two spaces per level, while every value stays exactly as you typed it

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
}
Step 3

Export Your Converted Object

Once the object is in the output, you can take it with you in a couple of ways:

•
Copy to clipboard: One-click copying for quick pasting into your code editor or application
•
Download as file: Save as a .json file for later use or sharing with your team
•
Minify: Puts the object on a single line, handy for environment variables or test fixtures; click again for the indented version

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.