How to Format, Validate and Fix JSON Errors

One stray comma breaks an entire JSON file. Here’s how to format it so it’s readable, find errors fast, and avoid the classic mistakes.

🧩Free JSON Formatter
Format, validate and minify JSON with clear error messages.
Open tool →

Format and validate in one step

Paste the JSON into the JSON Formatter and click Format. If it's valid you get clean, indented output; if not, you get the error message with the exact line and column. It runs in your browser, so API keys and customer data stay private.

The 6 most common JSON mistakes

1) Trailing commas after the last item. 2) Single quotes instead of double quotes. 3) Unquoted keys like {name: "x"}. 4) Comments (JSON doesn't allow them). 5) Missing commas between items. 6) Special characters or line breaks inside strings that aren't escaped (use \n and \").

Minify for production

Click Minify to remove all whitespace – smaller payloads for APIs and config embedded in code.

Need YAML or CSV instead?

Use the YAML ⇄ JSON and CSV ⇄ JSON converters to switch formats.

Frequently asked questions

What does 'Unexpected token' mean?

The parser found a character it didn't expect at that position – check the character just before it.

Can JSON have comments?

Standard JSON can't; some tools accept JSONC, but strict parsers will fail.

Is my JSON uploaded?

No.

🧩Free JSON Formatter
Format, validate and minify JSON with clear error messages.
Open tool →

More guides