$ jsonfmt
Format, minify, validate. Runs locally.
input
Common causes of «invalid JSON»
Trailing comma. {"a": 1,} is fine in JS, invalid in JSON.
Single quotes. JSON accepts double quotes only.
Comments. JSON has none — a stray // TODO breaks parsing.
Unquoted keys. {key: 1} is valid JavaScript, invalid JSON.
NaN and Infinity. Not in the spec — json.Marshal erroring on math.Inf(1) is by design.