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

How to Convert JSON Object to Array - Step by Step Guide

Step 1

Input Your JSON Object

Start with the object you want to wrap. It can be as small or as deeply nested as you like. You can:

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

Example: JSON Object Input

Here's what a JSON object 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:

•
Checks the input: Makes sure it parses as JSON and that the top level is an object, and shows the line and column if it doesn't
•
Adds brackets: Wraps the object in an array by adding outer square brackets
•
Formats output: Re-indents the result with two spaces, keeping every value and key in the order you typed it

Example: Converted Array Output

The same data, now as a JSON array (brackets added):

[
  {
    "name": "Sarah Chen",
    "email": "[email protected]",
    "age": 20,
    "major": "Computer Science",
    "gpa": 3.8,
    "enrollmentYear": 2022
  }
]
Step 3

Export Your Converted Array

Once the array looks right, take it with you:

•
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 array on a single line; click again for the indented version

Frequently Asked Questions

What does this converter do to my JSON?

It puts square brackets around the object you paste, so {"id": 1} becomes [{"id": 1}], an array with one item in it. That is the whole change. The object itself is copied across untouched and re-indented with two spaces, or put on one line if you click Minify.

Does it turn the keys or values of my object into array items?

No. Some people mean "object to array" as Object.values() or Object.entries() in JavaScript, which pulls the object apart. This page does not do that: you get the same object back, wrapped in a list. Nested objects and arrays inside it are left exactly where they are.

Why would anything want an array with just one object?

Plenty of bulk endpoints, import screens and database tools only accept a list of records, even when you have a single record to send. MongoDB insertMany, a lot of REST batch routes and most JSON-to-CSV or table tools expect [ ... ] at the top. Wrapping the object here saves fiddling with brackets by hand.

Will any of my values or key order change?

No. The object is copied from your input as text, so 8901240544102066246 keeps every digit, 14.50 keeps its trailing zero, "00501" stays a string, and 1e21 and escapes like \u0041 stay as written. Keys stay in the order you typed them, including number-like keys such as "10" that JavaScript would normally move to the front. If a key appears twice in the same object, both copies are kept and a note under the output names it, because most JSON readers would only keep the last one.

What happens if I paste an array, a plain value or broken JSON?

An array is already a list, so the page says so and points you to JSON Array to Object, which does the reverse. A plain number, string or null gets a short message asking for an object. Broken JSON shows the line and column of the first problem with a plain explanation, such as a trailing comma or a missing quote.

Is my JSON uploaded anywhere?

No. The wrapping happens 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 Array to Object takes the object back out, JSON Splitter breaks a long array into pieces, and JSON Validator checks any JSON for syntax errors.