JSON Formatter

Pretty-print, validate, sort and minify JSON instantly. Errors show exactly what went wrong.

🔒 Runs entirely on your device. Nothing you paste or pick is uploaded.

How to use the JSON formatter

Paste JSON into the left box and press Format to pretty-print it, or Minify to strip all whitespace for the smallest possible payload. Turn on Sort keys to order every object's keys alphabetically, which makes two JSON documents much easier to compare.

Why is my JSON invalid?

The most common causes are:

  • Trailing commas after the last item in an object or array.
  • Single quotes instead of double quotes around strings and keys.
  • Unquoted keys, like {name: "x"} instead of {"name": "x"}.
  • Comments — standard JSON does not allow // or /* */.

The error message above tells you what the parser expected and where it stopped.

Is my data safe?

Yes. Formatting happens with your browser's built-in JSON.parse and JSON.stringify. Your data never leaves your computer, so it is safe for API responses, configs and logs.

More free tools