JSON Basics/Root number

A number can be the entire JSON document.

Section: Valid JSON roots

Root number

json
json
42
Explanation

This is valid JSON even though it is less common in practice.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Valid JSON roots
Root object
A JSON document can start with an object.
OpenIn sheetjsonsame section
Root array
A JSON document can start with an array.
OpenIn sheetjsonsame section
Root string
A single JSON string is also valid JSON.
OpenIn sheetjsonsame section
Root null
`null` is valid as a complete JSON document.
OpenIn sheetjsonsame section
Use double quotes for keys and strings
JSON requires double quotes, not single quotes.
OpenIn sheetjson1 tag match
Do not use trailing commas
Trailing commas make JSON invalid.
OpenIn sheetjson1 tag match