Practical guide

How to Format, Validate, and Fix JSON

Valid JSON follows strict syntax rules. Formatting makes nested data easier to inspect, while minifying removes unnecessary whitespace.

Open the free tool

Step-by-step

  1. Paste JSON into the formatter.
  2. Select Format to validate and indent it.
  3. If validation fails, read the error location.
  4. Fix quotes, commas, brackets, or property names.
  5. Select Minify when compact output is required.

Important tips

  • JSON strings and property names require double quotes.
  • Trailing commas are not allowed in standard JSON.
  • Formatting changes whitespace, not the data itself.

Frequently asked questions

Why is my JSON invalid?

Common causes are trailing commas, single quotes, and missing brackets.

Does minifying JSON lose data?

No. It only removes unnecessary whitespace.

Related guides