Back to blog list
Developer Guide

What Is a JSON Array? Standard Lists and Formats

Quick Summary

A JSON array is an ordered list of values enclosed in square brackets ([]) with values separated by commas.

Deep Dive: What is a JSON Array?

While JSON objects ({ }) are perfect for mapping specific keys to values, JSON Arrays are optimized for managing ordered lists of elements. Represented as text wrapped in square brackets [ ], a JSON array holds a sequence of values that are indexed starting at 0.

["Astro", "Tailwind", "TypeScript"]

Allowed Types in JSON Arrays

An array does not contain key/value pairs. Instead, it contains a simple list of values separated by commas. Each value can be any valid JSON data type:

  1. Strings: ["Apple", "Banana", "Cherry"]
  2. Numbers: [200, 404, 500]
  3. Booleans: [true, false, true]
  4. Nulls: [null, null]
  5. JSON Objects: A collection of objects is highly standard for database queries:
    [
      {"name": "Alice", "score": 95},
      {"name": "Bob", "score": 88}
    ]
    
  6. Nested Arrays (Multi-dimensional): [[1, 2], [3, 4]]

Core Differences: Objects vs. Arrays

Understanding the difference between objects and arrays is vital for drafting correct databases schemas:

MetricJSON Object ({ })JSON Array ([ ])
StructureUnordered key-value recordsOrdered, indexed sequence
Primary IdentifierNamed double-quoted String keysNumeric indexing (0, 1, 2…)
Ideal ForModelling a single descriptive entityHolding data matrices or lists of items

Analyzing Large JSON Arrays

When debugging long API outputs that return lists of objects, viewing raw code gets extremely tiring.

Using an online rendering utility like our JSON Viewer transforms long arrays of objects into clean, expandable collapsible paths, letting you search indexes or copy paths with a click.


Frequently Asked Questions

Can a JSON array contain mixed value types?

Yes. Unlike strongly-typed languages, a standard JSON array can contain a mixture of strings, numbers, objects, and null values in the same list. However, keeping arrays homogeneous is recommended for easier programmatic parsing.

Need to work with JSON right now?

Check out our 100% private, fast, browser-based tools.

Open Free JSON Viewer