JSON Formatter

Format, minify and validate JSON. If it is broken, it tells you where.

Runs in your browser. Nothing you type is sent anywhere.

About the JSON Formatter

JSON Formatter makes JSON readable with consistent indentation, or minifies it onto one line. If the JSON is invalid, it says what is wrong and where, so you can fix it.

How to use it

  1. Paste your JSON.
  2. Choose 2 spaces, 4 spaces, tabs or minify.
  3. Copy the result, or fix the error it points to.

Example

{"tool":"json-formatter","free":true} becomes a neatly indented block with one key per line. Minify turns it back into a single line.

Questions

Why is my JSON invalid?

Common causes are trailing commas, single quotes instead of double quotes, and unquoted keys. The error message shows the position.

Does it change my data?

No. Only whitespace changes; values and key order stay the same.

Is it safe for API keys or private data?

It runs in your browser and nothing is sent anywhere.