JSON Formatter & Validator

Paste JSON from an API response, log or config file to pretty-print it, minify it, or find out exactly where it is broken.

Your JSON is parsed in your browser and never uploaded — safe for API responses that contain tokens or personal data.

How to format or validate JSON

  1. Paste your JSON into the input box.
  2. Click Format to pretty-print it with indentation, or Minify to remove all unnecessary whitespace.
  3. If the JSON is invalid, you'll see a message with the line and column of the first problem, and the cursor jumps there so you can fix it.
  4. Copy or download the result. Edit result moves it back into the input box for further changes.

The most common JSON errors

ErrorWrongRight
Trailing comma[1, 2, 3,][1, 2, 3]
Single quotes{'a': 1}{"a": 1}
Unquoted key{a: 1}{"a": 1}
Comments{"a": 1 // note}Not allowed in JSON
Missing comma{"a": 1 "b": 2}{"a": 1, "b": 2}
Special valuesNaN, undefinednull

JSON is stricter than JavaScript object syntax. Many of these are allowed in JavaScript, JSON5 or YAML, which is why copy-pasted snippets often fail validation.

Things to know

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser with JavaScript’s built-in JSON parser. That makes it safe to paste API responses that contain access tokens, emails or customer data.

Why does it say my JSON is invalid when it works in my code?

JavaScript and many config formats accept things that strict JSON doesn’t: single quotes, unquoted keys, trailing commas and comments. The error message points to the exact line and column so you can fix it.

What is the difference between formatting and minifying?

Formatting (beautifying) adds line breaks and indentation so humans can read the structure. Minifying removes all whitespace that isn’t inside strings, producing the smallest equivalent text.

Can it handle large files?

Yes, files of several megabytes format in well under a second on a typical computer. Extremely large files (hundreds of megabytes) may exceed browser memory.