JSON Cheat Sheet

Search quick JSON syntax reminders for objects, arrays, strings, escapes, booleans, nulls, parsing, and formatting.

Last updated: August 2026 | By Workshelve Team

Object

{
  "name": "Workshelve",
  "active": true
}

JSON objects use curly braces with quoted string keys.

Array

[
  "json",
  "yaml",
  "xml"
]

JSON arrays use square brackets and comma-separated values.

Nested data

{
  "tool": {
    "id": "json-parser",
    "tags": ["format", "data"]
  }
}

Objects and arrays can be nested freely as long as syntax stays valid.

String

{
  "title": "Hello world"
}

Strings must use double quotes in JSON.

Number

{
  "count": 25,
  "ratio": 0.75
}

JSON numbers do not use quotes unless you want them treated as strings.

Boolean

{
  "enabled": true,
  "archived": false
}

Boolean values are lowercase true and false.

Null

{
  "owner": null
}

Use null for an intentionally empty value.

Escaped text

{
  "message": "Line 1\nLine 2\tTabbed"
}

Use backslash escapes inside JSON strings for control characters.

Pretty print

JSON.stringify(value, null, 2)

This produces readable indented JSON in JavaScript.

Parse

JSON.parse(text)

Parsing turns JSON text into a JavaScript value and throws on invalid syntax.

Top-level array

[{"id":1},{"id":2}]

A JSON document can be an array, not only an object.

No comments

{
  "note": "JSON does not allow comments"
}

Standard JSON does not support comments, trailing commas, or single-quoted strings.

Strict syntax rules

JSON is stricter than JavaScript object literals, so keys and strings must use double quotes and comments are not allowed.

Small examples on purpose

Each snippet is meant to be fast to scan when you need a quick reminder rather than a long tutorial.

Great for debugging

This kind of reference is especially useful when fixing malformed payloads, fixtures, or API responses.

Related Tools