JSON formatter and validator

Paste JSON to make it readable, check it for errors or minify it for production. Errors show the line and column so you can fix them fast.

Private: works in your browser, nothing is uploaded.

How to use the JSON Formatter tool

  1. Paste your JSON into the input box.
  2. Click “Format” to pretty print, “Minify” to compress, or “Sort keys” to order keys alphabetically.
  3. If the JSON is invalid, read the error with its line and column.
  4. Copy the result.

Why format JSON?

APIs and log files usually return JSON as one long line that is impossible to read. Formatting adds line breaks and indentation, so you can see the structure, find a field quickly and compare responses. Minifying does the opposite: it removes all whitespace to make files and network requests smaller.

Common JSON errors

  • Trailing commas after the last item: [1, 2, 3,].
  • Single quotes instead of double quotes around strings and keys.
  • Keys without quotes: {name: "x"} is JavaScript, not JSON.
  • Comments: JSON does not allow // or /* */.
  • Special values like undefined, NaN or Infinity.

The validator uses your browser’s strict JSON parser, the same one used by real applications, so if it passes here it will parse everywhere.

Privacy

Everything you type stays in your browser. Nothing is sent to a server or stored. That makes it safe for API responses with tokens, customer data or configuration files.

Frequently asked questions

What does “Sort keys” do?

It orders object keys alphabetically at every level, which makes two JSON files easy to compare.

Is there a size limit?

No upload limit. Files of several megabytes format instantly on most computers.

Can it fix my JSON automatically?

No. It shows where the error is so you can fix it. Automatic fixing could silently change your data.

Does it support JSON5 or comments?

No. It validates standard JSON as defined in RFC 8259.