JSON Basics/Do not use trailing commas

Trailing commas make JSON invalid.

Section: Core syntax rules

Do not use trailing commas

json
json
{
  "name": "Ada",
  "role": "admin"
}
Explanation

A trailing comma after the last property or array item is a frequent parse failure.

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 Core syntax rules
Use double quotes for keys and strings
JSON requires double quotes, not single quotes.
OpenIn sheetjsonsame section
Do not add comments
Standard JSON does not support comments.
OpenIn sheetjsonsame section
Pretty-print JSON with jq
Format JSON into a readable structure.
OpenIn sheetbashsame section
Validate JSON with Python
Check whether a file parses as valid JSON.
OpenIn sheetbashsame section
Root object
A JSON document can start with an object.
OpenIn sheetjson1 tag match
Root array
A JSON document can start with an array.
OpenIn sheetjson1 tag match