When you see square brackets [ ] in JSON syntax, they usually indicate a JSON array. An array is a structured list that can contain zero or more JSON values, with those values separated by commas. The opening bracket [ starts the array, and the closing bracket ] ends it. This behavior is defined by the JSON standard in RFC 8259 and ECMA-404.
For example:
["Apple", "Banana", "Orange"]
Here, the square brackets tell the JSON parser that three values belong to the same array.
Understanding JSON square brackets is important because arrays are one of the main ways JSON represents lists of data. They appear frequently in API responses, configuration files, application data, databases, and communication between software systems.
What Do Square Brackets Mean in JSON?
In JSON, square brackets represent an array structure.
The basic form is:
[value1, value2, value3]
According to the JSON grammar, an array consists of an opening square bracket, zero or more values separated by commas, and a closing square bracket.
Each item inside the brackets is called an element.
For example:
["red", "green", "blue"]
The array contains three elements:
"red""green""blue"
An array can also contain just one value:
["red"]
Or it can be empty:
[]
An empty array is completely valid JSON because the specification permits an array to contain zero values.
Why Does JSON Use [ ]?
JSON uses different punctuation to distinguish different kinds of structured data.
Curly braces { } represent an object containing name/value pairs.
Square brackets [ ] represent an array containing a sequence of values.
For example:
{
"name": "Alex",
"age": 30
}
is an object, while:
["Alex", 30]
is an array.
This distinction makes the structure of JSON data clear to both humans and software.
The JSON specification defines objects and arrays separately, with objects surrounded by curly braces and arrays surrounded by square brackets.
Basic JSON Square Bracket Syntax
The simplest JSON array looks like this:
["Apple", "Banana", "Orange"]
The syntax has three important parts:
[ value , value , value ]
The [ starts the array.
The , separates elements.
The ] ends the array.
For example:
[10, 20, 30]
contains three numeric values.
Another example:
["John", "Sarah", "Michael"]
contains three strings.
The comma is a separator, not an additional value. Every element except the final one is followed by a comma when another element comes after it.
What Can Go Inside JSON Square Brackets?
One of the useful properties of JSON arrays is that their elements can be different JSON value types.
A JSON value can be an object, array, number, string, true, false, or null.
That means an array can contain strings:
["Alice", "Bob", "Charlie"]
Numbers:
[10, 25, 50, 100]
Boolean values:
[true, false, true]
null:
[null, null]
Objects:
[
{"name": "Alice"},
{"name": "Bob"}
]
Or even a mixture:
[
"Alice",
25,
true,
null
]
The JSON standard does not require all elements in an array to have the same type.
In real applications, however, APIs often define a specific expected structure. For example, an API may specify that every element in a particular array should be an object containing id and name.
![JSON Syntax Square Brackets | What [ ] Mean in JSON](http://techindaily.com/wp-content/uploads/2026/08/JSON-Syntax-Square-Brackets-1-1024x683.png)
JSON Square Brackets and Arrays of Objects
A very common JSON pattern is an array containing multiple objects.
For example:
[
{
"id": 1,
"name": "Alice"
},
{
"id": 2,
"name": "Bob"
},
{
"id": 3,
"name": "Charlie"
}
]
The outer square brackets indicate that this is an array.
Each set of curly braces represents one object inside the array.
Conceptually, you can think of it as:
Array
├── Object
├── Object
└── Object
This structure is extremely common in web APIs because a server may need to return a list of records.
For example, an API could return a list of products:
{
"products": [
{
"id": 101,
"name": "Laptop"
},
{
"id": 102,
"name": "Monitor"
}
]
}
Here, "products" is a property of the outer object, and its value is an array.
The square brackets therefore mean that multiple product objects are grouped into a list.
Nested Square Brackets in JSON
JSON arrays can contain other arrays.
This creates a nested array.
For example:
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
The outer [ and ] define the main array, while each inner pair defines another array.
You can visualize the structure as:
Outer array
├── Inner array [1, 2, 3]
├── Inner array [4, 5, 6]
└── Inner array [7, 8, 9]
Nested arrays are useful for representing data with multiple levels, such as rows and columns.
For example:
[
["Name", "Age"],
["Alice", 30],
["Bob", 25]
]
The first nested array could represent column headings, while the following arrays represent rows.
JSON itself defines the syntax, but the meaning assigned to such structures depends on the application using the data. ECMA-404 specifically notes that the JSON syntax defines the structure but does not impose application-specific semantics on it.
Square Brackets With Objects
Arrays and objects are often combined.
For example:
{
"name": "Tech Daily",
"tags": [
"JSON",
"Programming",
"Web Development"
]
}
Here:
"tags": [...]
means the tags property contains an array.
Another common pattern is:
{
"users": [
{
"name": "Alice",
"active": true
},
{
"name": "Bob",
"active": false
}
]
}
This is a typical example of objects containing arrays of objects.
Such structures are common in REST APIs and other data-exchange systems because they allow a response to contain both descriptive information and a collection of records.
Square Brackets Do Not Mean “Optional” in JSON
This is a common source of confusion.
In some documentation, square brackets may be used informally to mean something is optional. For example, a technical document might write:
parameter [optional]
That convention is not the same thing as JSON syntax.
In actual JSON data:
[]
means an empty array.
And:
["Apple", "Banana"]
means an array containing two elements.
The square brackets themselves are actual JSON structural characters. RFC 8259 defines [ as the begin-array token and ] as the end-array token.
JSON Arrays Can Be Empty
An empty array is valid:
[]
This can be useful when an application has a collection with no elements.
For example:
{
"notifications": []
}
This means the notifications property contains an array, but there are currently no notification elements in it.
An empty array is different from null.
Compare:
{
"notifications": []
}
with:
{
"notifications": null
}
The first explicitly provides an empty collection. The second provides the JSON value null.
The exact application-level meaning of null or an empty array depends on the API or data model, but they are different JSON values.
How Commas Work Inside [ ]
Array elements are separated by commas.
Valid:
["A", "B", "C"]
Also valid:
[
"A",
"B",
"C"
]
Whitespace and line breaks can be used around JSON’s structural characters without changing the data.
However, JSON does not allow a trailing comma after the final element.
This is invalid JSON:
["A", "B", "C",]
The comma after "C" has no following element.
It must instead be:
["A", "B", "C"]
Modern JavaScript allows trailing commas in many array and object literals, but JSON does not. This difference is a frequent reason a JSON document that looks correct to a JavaScript developer fails to parse.
Single Quotes Are Not Correct JSON String Syntax
Another frequent mistake is writing:
['Apple', 'Banana', 'Orange']
This resembles JavaScript syntax, but it is not valid JSON.
JSON strings must use double quotation marks:
["Apple", "Banana", "Orange"]
The same rule applies to object property names.
Invalid:
{
'name': 'Alice'
}
Valid:
{
"name": "Alice"
}
MDN’s JSON.parse() documentation confirms that JSON strings must use double quotes rather than single quotes.
JSON Square Brackets vs JavaScript Square Brackets
JSON is closely related to JavaScript, but JSON is not the same thing as JavaScript code.
In JavaScript, square brackets can be used for several different purposes.
For example:
const colors = ["red", "green", "blue"];
Here they create a JavaScript array.
JavaScript also uses square brackets to access an array element:
colors[0]
which accesses the first element of the JavaScript array.
JavaScript commonly uses zero-based indexing, meaning the first element is at index 0.
JSON itself is different. JSON defines the serialized data format. It does not define programming-language operations such as accessing an element with an index.
This distinction is important:
["red", "green", "blue"]
is JSON data.
But:
colors[0]
is a JavaScript expression that operates on a JavaScript array.
The JSON standard deliberately defines syntax for data interchange rather than prescribing how a programming language must internally represent or manipulate the data.
How to Read JSON Square Brackets Easily
A simple way to read JSON is to treat square brackets as meaning:
“Here is a list of values.”
For example:
["Laptop", "Mouse", "Keyboard"]
can be read as:
A list containing Laptop, Mouse, and Keyboard.
Now consider:
{
"devices": ["Laptop", "Phone", "Tablet"]
}
You can read it as:
The
devicesproperty contains a list of three devices.
And:
{
"categories": [
{
"name": "Computers"
},
{
"name": "Phones"
}
]
}
can be understood as:
The
categoriesproperty contains a list, and each item in that list is an object.
This mental model makes even deeply nested JSON much easier to understand.
Common JSON Square Bracket Errors
Many JSON syntax errors happen around arrays.
Missing Closing Bracket
Invalid:
["Apple", "Banana", "Orange"
The array starts with [ but never ends with ].
Correct:
["Apple", "Banana", "Orange"]
Extra Closing Bracket
Invalid:
["Apple", "Banana"]]
There is an extra ] that does not correspond to an opening array.
Missing Comma
Invalid:
["Apple" "Banana"]
The two values need a comma between them.
Correct:
["Apple", "Banana"]
Trailing Comma
Invalid:
["Apple", "Banana",]
Correct:
["Apple", "Banana"]
Using Single Quotes
Invalid:
['Apple', 'Banana']
Correct:
["Apple", "Banana"]
Leaving the Array Empty Incorrectly
An empty array itself is valid:
[]
But this is not:
[,]
There is no JSON value between the comma separators.
JSON parsers such as JavaScript’s JSON.parse() throw a SyntaxError when the supplied text does not conform to the JSON grammar.
How JSON Square Bracket Errors Are Usually Reported
When malformed JSON is parsed, the error message often points to the location where the parser encountered something unexpected.
For example, JavaScript’s JSON.parse() can report messages associated with problems such as:
expected ',' or ']' after array element
or:
end of data while ',' or ']' was expected
These messages are useful because they indicate that the parser was inside an array and expected either another element separator or the array’s closing bracket.
Consider:
[
"Apple",
"Banana"
"Orange"
]
After "Banana", the parser expects either:
,
to indicate another element, or:
]
to finish the array.
Instead it finds another string, so parsing fails.
The best troubleshooting approach is usually to check the array from the opening [ and verify that every element is correctly separated and that the array eventually closes with ].
JSON Square Brackets in APIs
Square brackets are especially important when working with APIs.
Suppose an API returns:
{
"status": "success",
"users": [
{
"id": 1,
"name": "Alice"
},
{
"id": 2,
"name": "Bob"
}
]
}
A developer can immediately see that:
statusis a string.usersis an array.- Each element of
usersis an object. - Each object contains an
idandname.
This is one reason JSON became widely used for data interchange: its syntax provides a relatively compact and readable way to represent nested information. JSON is formally described as a lightweight, text-based, language-independent data interchange format.
Are JSON Arrays Ordered?
There is a subtle technical point here.
JSON’s array structure represents a sequence of values, but the specification does not itself assign application-specific meaning to the position of those values. ECMA-404 notes that JSON syntax does not define a specific semantic meaning for ordering, even though applications commonly use array position meaningfully.
For example:
["first", "second", "third"]
clearly has a sequence in its serialized representation.
An application might interpret index or position as meaningful, such as a list ordered from newest to oldest. Another application might treat the values as a collection where order is not important.
The application or API contract determines what the ordering means.
This is different from JSON objects, whose member ordering is not defined as semantically significant by the JSON syntax.
JSON Arrays and Indexing
It is also important not to confuse JSON syntax with programming-language indexing.
Suppose you have:
["Apple", "Banana", "Orange"]
JSON describes an array containing three values.
When a programming language parses that JSON, it may convert the array into its own native array or list structure.
For example, JavaScript can parse JSON with:
const fruits = JSON.parse('["Apple", "Banana", "Orange"]');
JSON.parse() converts valid JSON text into the corresponding JavaScript value.
After that conversion, JavaScript code can access an element with:
fruits[0]
which refers to "Apple" in JavaScript’s zero-indexed array model.
So the distinction is:
| Concept | Meaning |
|---|---|
[ in JSON | Starts an array |
] in JSON | Ends an array |
, in JSON array | Separates elements |
array[0] in JavaScript | Accesses an element by index |
[] | Empty JSON array |
How to Check Whether JSON Square Bracket Syntax Is Correct
When a JSON array does not parse, check the structure in this order.
First, make sure the array starts with:
[
Then verify that every element is a valid JSON value.
Make sure adjacent elements are separated by commas:
["A", "B", "C"]
Check that there is no trailing comma:
["A", "B", "C"]
rather than:
["A", "B", "C",]
Also verify that all strings use double quotes:
["A", "B"]
Finally, make sure every opening square bracket has the correct closing bracket:
[
["A", "B"],
["C", "D"]
]
Nested structures can become difficult to inspect manually, so formatting JSON with indentation or using a parser/validator can make structural errors much easier to locate.
JSON Square Brackets vs Curly Braces
A simple comparison helps explain the difference:
{
"name": "Alice",
"age": 30
}
This is an object. It uses property names and values.
By contrast:
["Alice", 30]
is an array. It contains values in a sequence.
You can combine them:
{
"person": {
"name": "Alice",
"skills": [
"Python",
"JavaScript",
"JSON"
]
}
}
In this example:
{ }creates objects.[ ]creates arrays.:separates object property names from their values.,separates neighboring members or array elements.
These structural characters form the core of JSON’s grammar.
Why JSON Square Brackets Matter
Square brackets may look like a small part of JSON syntax, but they are essential for representing collections of data.
Without arrays, an API would have difficulty expressing a simple list such as:
users
products
orders
messages
files
tags
permissions
JSON makes these collections easy to represent:
"tags": ["technology", "JSON", "API"]
or:
"users": [
{"id": 1},
{"id": 2},
{"id": 3}
]
This combination of simple structural characters and composable objects and arrays is a major reason JSON is useful for structured data interchange across different systems. The format is designed to be portable and language-independent rather than tied to a particular programming language.
FAQ: JSON Square Brackets
What do square brackets [ ] mean in JSON?
They define a JSON array, which is a sequence containing zero or more JSON values separated by commas.
Can a JSON array be empty?
Yes. This is valid JSON:
[]
An empty array contains no elements.
Can JSON arrays contain objects?
Yes. For example:
[
{"name": "Alice"},
{"name": "Bob"}
]
An array may contain objects, arrays, strings, numbers, booleans, or null.
Can JSON arrays contain different data types?
Yes. The JSON specification does not require all elements in an array to have the same type.
Can JSON use a trailing comma before ]?
No. JSON does not allow trailing commas.
Invalid:
["A", "B",]
Valid:
["A", "B"]
Are [ ] and { } the same in JSON?
No. Square brackets create arrays, while curly braces create objects. Arrays contain values; objects contain name/value members.
Are JSON square brackets the same as JavaScript array brackets?
They look similar because JSON was derived from JavaScript-related syntax, but JSON is a separate data-interchange format. JavaScript also uses square brackets for operations such as array indexing, while JSON defines square brackets specifically as the delimiters of an array structure.
Final Takeaway
The easiest way to remember JSON square bracket syntax is:
[ = start an array
] = end an array
, = separate array elements
So:
["Apple", "Banana", "Orange"]
means one array containing three values.
Square brackets can also surround objects:
[
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}
]
or other arrays:
[
[1, 2],
[3, 4]
]
The key rules are straightforward: arrays use [ ], elements are separated by commas, strings use double quotes, and trailing commas are not valid JSON. These rules are part of the formal JSON grammar defined by RFC 8259 and ECMA-404.
For most readers, the single most useful mental model is simply this: when you see [ ] in JSON, think “list of values.”
Also Read: Gold Price Per Gram EUR Free API Python

![JSON Syntax Square Brackets | What [ ] Mean in JSON JSON Syntax Square Brackets | What [ ] Mean in JSON](https://techindaily.com/wp-content/uploads/2026/08/Tech-In-Daily-JSON-Syntax-Square-Brackets-1024x576.png)
![JSON Syntax Square Brackets | What [ ] Mean in JSON](http://techindaily.com/wp-content/uploads/2026/08/JSON-Syntax-Square-Brackets-2-1024x576.png)