JSON Formatter & Validator

By Stuart Mathieson · Updated October 2026

Tips:

  • Paste minified or unformatted JSON to validate and beautify it
  • Use Minify to compress formatted JSON
  • Errors will be highlighted with their location

How the JSON formatter works

The formatter reads your text with the browser's built-in JSON parser, which follows the JSON standard (RFC 8259). If it parses, the data is written back out either indented with 2 spaces (Format) or with all optional whitespace removed (Minify). Because the output is rebuilt from the parsed data, it is always valid JSON.

Example

This minified input:

{"name":"Ada","skills":["math","code"],"active":true}

formats as:

{
  "name": "Ada",
  "skills": [
    "math",
    "code"
  ],
  "active": true
}

Common errors and how to fix them

Common JSON errors
ProblemInvalidValid
Trailing comma{"a": 1,}{"a": 1}
Single quotes{'a': 1}{"a": 1}
Unquoted key{a: 1}{"a": 1}
Comment{"a": 1} // note{"a": 1}
NaN or undefined{"a": NaN}{"a": null}

Things to know

Frequently asked questions

What happens if my JSON is invalid?

You'll see the specific parsing error, which usually points to the exact issue - a trailing comma, missing quote, or unmatched bracket, for example.

What's the difference between format and minify?

Format adds indentation and line breaks so the JSON is easy to read. Minify strips all unnecessary whitespace to make the payload as small as possible - useful before sending data over a network.

Does this send my data anywhere?

No - parsing and formatting happen entirely in your browser using JavaScript's built-in JSON support. Nothing is uploaded or logged.

Can JSON contain comments?

No. The JSON standard doesn't allow comments, so remove them before formatting. Some tools accept variants such as JSONC for configuration files, but standard JSON parsers reject them.

Sources