142+ Free Online Tools · Easy. Fast. Accurate.

JSON Formatter

Pretty-print or minify JSON, instantly in your browser.

How to use the JSON Formatter

  1. Paste your JSON.
  2. Choose 2 spaces, 4 spaces or tab indentation to beautify it, or Minify to compress it.
  3. Click Run and copy the formatted JSON.

How the JSON Formatter works

The formatter parses your input with the browser's built-in JSON parser, which also validates it, and then writes it back out with your chosen indentation, or with no whitespace at all for Minify. Objects and arrays are expanded so each key or item sits on its own line.

Because the data really is parsed, common mistakes such as trailing commas, single-quoted strings, comments and unquoted keys are reported as errors. Formatting changes only whitespace; key order and values stay exactly as they were.

Frequently asked questions

Is this tool free?
Yes. Format JSON at no cost, with no account required.
What happens if my JSON is invalid?
You'll see an error message describing what's wrong so you can fix it. Use the JSON Validator for a dedicated validity check.
Does formatting change my data?
No. Only whitespace changes. Keys, values and their order are preserved exactly.
Does my text leave my browser?
No. The conversion runs entirely in your browser, so your text is never sent to a server.

More Text Tools

Browse all Text Tools →