JSON Formatter and Validator

Paste JSON to format, minify or check it. Processing happens in your browser.

How it works

The tool parses your text with the browser's built-in JSON parser, then writes it back with two-space indentation (Format) or no whitespace (Minify). Strict JSON is required: no comments, no trailing commas, and keys must use double quotes.

Large numbers beyond JavaScript's safe integer range may lose precision when re-serialized.

How to use it

  1. Paste or type JSON into the input box, or choose Load example.
  2. Choose Format to indent it, Minify to remove whitespace, or Validate to check it.
  3. If the JSON is invalid, the message gives the problem and its line and column. Fix it and try again.
  4. Choose Copy result to copy the output.

Common errors

The most frequent causes are a trailing comma after the last item, single quotes instead of double quotes, and unquoted keys. For example, {"a": 1,} is invalid because of the comma before the closing brace.

Frequently asked questions

Why does my JSON fail when it works in JavaScript?

JSON is stricter than JavaScript objects. Keys and strings need double quotes, trailing commas are not allowed and comments are not part of JSON.

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in your browser.

What is the difference between formatting and minifying?

Formatting adds line breaks and indentation for readability. Minifying removes all optional whitespace to make the text smaller.

Related tools