About this tool
Malformed JSON is one of the most common — and most frustrating — sources of bugs in web development, since a single missing comma or unescaped quote can break an entire API response. This tool parses your JSON and pinpoints the exact line and character of any syntax error, then pretty-prints valid JSON with consistent indentation, or minifies it down to a single line for production use. Optional key sorting normalizes object key order alphabetically, which is particularly useful when diffing two JSON payloads that should be structurally identical but were generated in different key orders. All parsing and formatting happens locally in your browser, so API responses containing tokens, credentials, or customer data are never transmitted anywhere.
Frequently asked questions
Why does it say my JSON is invalid when it looks fine?
JSON is stricter than JavaScript object literals — trailing commas, single quotes, and unquoted keys are all valid JavaScript but invalid JSON, and the validator will flag them.
Can it sort object keys alphabetically?
Yes — enable key sorting to normalize key order, which is useful when diffing two JSON files.
Does formatting change the data itself?
No — formatting only changes whitespace and indentation; the underlying values and structure remain identical.
What does minify do?
Minify strips all unnecessary whitespace and line breaks, producing the smallest valid JSON representation, useful for production payloads.
Does it show exactly where a syntax error is?
Yes — invalid JSON is reported with the specific line and character position of the problem rather than a generic error.