Parse a file and fail if JSON is invalid.

Section: Validate JSON files

Validate with jq

bash
bash
jq empty input.json
Explanation

`jq empty` is concise and script-friendly for validation-only workflows.

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 Validate JSON files
Validate with Python json.tool
Check syntax and pretty-print if valid.
OpenIn sheetbashsame section
Validate with Node.js
Parse a file with JavaScript runtime tooling.
OpenIn sheetbashsame section
Rewrite valid JSON in normalized form
Read and immediately re-emit clean JSON.
OpenIn sheetbash2 tag match
Single quotes are invalid
Strings and keys must use double quotes.
OpenIn sheetjson1 tag match
Trailing commas are invalid
Do not leave a comma after the last item.
OpenIn sheetjson1 tag match
Object keys must be quoted
Bare identifiers are invalid in JSON.
OpenIn sheetjson1 tag match