Skip to content
kitbaba

Most used

JSON formatter

Format, validate and minify JSON, with clear error messages.

Processed on your device · 0 bytes uploaded

How to use

  1. Paste your JSON into the Input box, or press Load example.
  2. Press Format (or Ctrl+Enter, Cmd+Enter on a Mac) to indent it. Press Minify to remove all whitespace.
  3. Pick 2 spaces, 4 spaces or tabs for the indentation.
  4. If the JSON is invalid, the status line shows the line and column, and the cursor jumps to the problem.
  5. Press Copy to copy the result.

Questions

Is my JSON sent to a server?

No. Formatting happens in your browser with JavaScript. Nothing you paste is uploaded or stored.

Will large numbers lose precision?

No. Many formatters parse the JSON and print it again, which rounds integers above 2^53. This one only changes whitespace, so 12345678901234567890 stays exactly as you wrote it.

What happens to duplicate keys?

They are kept as they are. The JSON is still checked for errors, but the output is your original text with new indentation.

Does it accept comments or trailing commas?

No. It checks for strict JSON, the format that JSON.parse and most APIs accept. Comments, single quotes and trailing commas are reported as errors.

Something wrong or missing? Tell us (opens in a new tab)