JSON Formatter
Paste JSON — get it formatted, validated with exact error positions, or minified to one line. Nothing is uploaded, safe for sensitive API data.
Paste JSON and click Format, Minify or Validate.
Format, validate, minify
API responses arrive minified, log entries get mangled by copy-paste, and a single missing comma breaks everything silently. This tool covers the three fixes developers need dozens of times a day — with a validator that doesn't just say "invalid" but tells you the line and column where parsing failed.
Paste your JSON
From an API response, a log line, a config file — it stays in your browser.
Choose the operation
Format for readability, Minify for transfer, Validate to hunt down syntax errors.
Copy the result
One click copies the output; sorting keys alphabetically makes diffs between versions stable.
The errors the validator catches
Almost every invalid JSON comes down to a handful of culprits: a trailing comma after the last item (valid in JavaScript, invalid in JSON), single quotes instead of double quotes, unquoted keys, comments (JSON has none), or a missing closing bracket. The validator reports the position where parsing failed — the actual mistake usually sits immediately before it. Key sorting has a second use beyond tidiness: two JSON files with sorted keys diff cleanly in version control, making config changes reviewable.
Frequently asked questions
How do I format messy JSON?
Paste the JSON and click Format. It's re-indented with your chosen indentation (2 spaces, 4 spaces or tabs) and nested structures become readable.
How do I find a syntax error in JSON?
Click Validate — if the JSON is invalid, the tool shows the error message with the line and column where parsing failed, typically a missing comma, quote or bracket right before that position.
What does minifying JSON do?
It removes all whitespace and line breaks, producing the smallest valid representation — useful for APIs, config payloads and reducing transfer size.
Is my JSON uploaded to a server?
No. Parsing and formatting run entirely in your browser, which makes the tool safe for API responses containing internal or sensitive data.