JSON Validation and Common Errors/Trailing commas are invalid

Do not leave a comma after the last item.

Section: Common parse failures

Trailing commas are invalid

json
json
[
  1,
  2,
  3
]
Explanation

`[1,2,3,]` is invalid JSON.

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 Common parse failures
Single quotes are invalid
Strings and keys must use double quotes.
OpenIn sheetjsonsame section
Object keys must be quoted
Bare identifiers are invalid in JSON.
OpenIn sheetjsonsame section
Raw newlines inside strings are invalid
Use `\n` rather than an actual line break inside a string literal.
OpenIn sheetjsonsame section
Rewrite valid JSON in normalized form
Read and immediately re-emit clean JSON.
OpenIn sheetbashsame section
Validate with jq
Parse a file and fail if JSON is invalid.
OpenIn sheetbash1 tag match
Validate with Python json.tool
Check syntax and pretty-print if valid.
OpenIn sheetbash1 tag match