JSON formatter and validator

Pretty-print, minify or validate JSON, with the exact parse error location when something is wrong.

About json formatter and validator

Formatting reveals structure; minifying strips every optional byte for transport. Either way the document is parsed first, so an invalid file is reported rather than silently mangled.

The YAML button dumps the parsed structure as YAML, which is a convenient one-way export when you need to paste a payload into a config file.

Frequently asked

Why does my JSON fail to parse? The usual causes are trailing commas, single quotes instead of double, unquoted keys, or a comment. None of those are valid JSON, though most are valid JavaScript.