JSON syntax is a subset of the JavaScript object notation syntax. It is much stricter than standard JavaScript objects, and failure to follow even one small rule (like a missing comma or a single quote) will result in a parsing error.
Try writing some JSON below. Click "Validate" to check if it follows the strict rules:
JSON data is written as name/value pairs. A name/value pair consists of a field name (in double quotes), followed by a colon, followed by a value.
"firstName": "John"
Every name/value pair in an object must be separated by a comma (,). However, **do not** place a comma after the last pair.
{
"city": "New York",
"zip": 10001
}
Objects are surrounded by curly braces. They contain unordered key-value pairs.
Arrays are surrounded by square brackets. They contain an ordered list of values.
A JSON value can be:
You cannot use the following in standard JSON:
: separate names from values., separate items.