JSON Basics

What is the difference between {} and [] in JSON?

In JSON, curly braces {} represent objects containing key-value pairs, while square brackets [] represent arrays containing ordered lists of values. Objects use keys as identifiers, like {"name": "John", "age": 30}, where each value is accessed by its key. Arrays contain indexed values without keys, like ["apple", "banana", "cherry"], accessed by numeric position. Objects are best for representing entities with named properties, while arrays are ideal for collections of similar items. Objects require string keys in double quotes, whereas arrays contain comma-separated values of any type. You can nest objects within arrays and vice versa for complex structures. Use our JSON Editor at jsonconsole.com/json-editor to visualize the difference in tree view, making it clear when to use objects versus arrays for your data structure needs.
Last updated: December 23, 2025

Still have questions?

Can't find the answer you're looking for? Please reach out to our support team.