JSON Formatter / Validator

Prettify, minify, or validate JSON, with clear error messages when something's wrong.

json-formatter.js

Paste any JSON and instantly prettify it with proper indentation, minify it to a single compact line, or just validate it and see exactly where a syntax error is if the JSON is broken. This is useful for reading messy API responses, debugging config files, or shrinking JSON before sending it somewhere with a size limit.

How to use it

  1. Paste your JSON into the input box.
  2. Click Prettify to format it with indentation, or Minify to compress it.
  3. If the JSON is invalid, an error message explains what's wrong and roughly where.
  4. Copy the formatted result.

Frequently asked questions

What happens if my JSON has a syntax error?

The tool shows the exact error message from the JSON parser, which usually points to the character position of the problem — a trailing comma or missing quote, for example.

Does minifying change the data?

No, minifying only removes whitespace and line breaks; the actual keys and values stay identical.

Can it handle very large JSON files?

Yes, though extremely large files (tens of megabytes) may take a moment to parse and render, since it all happens in your browser's memory.