JSON Syntax

Click Here

Data in JSON

The JSON data is stored in name/value pairs.

Example JSON data

"firstName":"Adam"

JSON object

The data is separated by commas.

Curly braces hold objects.

Example JSON object

{"firstName":"Adam", "lastName":"Smith"}

JSON Array

Square brackets hold arrays.

Example JSON array

{"contacts":[ {"firstName":"Adam", "lastName":"Smith"}, {"firstName":"Anne", "lastName":"Davis"}, {"firstName":"Bruce", "lastName":"Harris"}, {"firstName":"David", "lastName":"Lee"} ]}

In this example, the <>JSON object "contacts" contains 4 JSON objects with their corresponding data.

JSON files

The JSON file has the extension name "json".

Example filename with JSON data

data.json

The MIME type for JSON text is "application/json".


Click Here