Format, minify, and validate. Invalid input shows where it broke.
.
Validation uses the browser's own JSON parser, so it matches what your code will accept. On an error it reports the parser's message, which usually names the position of the problem. Nothing is sent or saved.