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

JSON examples

Simple JSON Example

This is the smallest useful JSON document: one object that contains every kind of value JSON supports. Use it to learn the syntax or as a quick test input.

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
namestringText in double quotes.
agenumberAn integer. JSON does not distinguish integers from decimals.
isMemberbooleantrue or false, written without quotes.
balancenumberA decimal number.
nicknamenullAn explicit empty value, different from a missing key.
languagesarray of stringsAn ordered list in square brackets.
addressobjectA nested set of key and value pairs.

Read it in code

JavaScript:

const data = JSON.parse(text);
console.log(data.address.city); // "London"

Python:

import json
data = json.loads(text)
print(data["address"]["city"])  # London

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