JSON Forge
100% Client-Side: your data is never sent to a server

JSON examples

JSON Array Example

Arrays hold ordered lists. This example shows the common shapes: a list of numbers, a list of strings, a list of records, a mixed list and an empty list.

Loading editor…
Paste or type JSON on the left to explore it as a tree.
Empty🔒 Processed locally in your browser

The example

The JSON above is the example. Explore it in the Tree tab, press Download to save it as a .json file, or Share to send someone a link to it. All names, ids, emails and values are invented.

Fields explained

PathTypeNotes
numbersarray of numbersEvery item has the same type.
colorsarray of stringsStrings in double quotes, separated by commas.
mixedarrayJSON arrays may mix types, including objects and other arrays. Avoid this in APIs, it is hard to type.
recordsarray of objectsThe most common shape in real APIs: a list of similar records.
emptyarrayAn empty list is valid and often means no results.

Read it in code

JavaScript:

const ids = data.records.map((r) => r.id); // [1, 2]
const last = data.numbers[data.numbers.length - 1]; // 8

Python:

ids = [r["id"] for r in data["records"]]  # [1, 2]
last = data["numbers"][-1]  # 8

What this example is good for

Tips

Convert this example

Open it in a converter, then switch the output in the Code tab:

More examples

All JSON examples · Cheat sheets