JSON Formatter

Format, validate, and minify JSON — pretty-print or compress in one click.

Format

Paste raw JSON to format or minify.

Scroll inside the box for long output; the copy button stays in view.

Formula used

Pretty (2-space indent):
  output = JSON.stringify(parsed, null, 2)

Minify (no whitespace):
  output = JSON.stringify(parsed)

Both first run JSON.parse(input); on failure the input is reported as invalid.

Worked example

Input (minified): {"name":"Ada","active":true,"roles":["admin","dev"]}

Pretty output:

{
  "name": "Ada",
  "active": true,
  "roles": [
    "admin",
    "dev"
  ]
}

Frequently asked questions

Is this a JSON validator?

Yes. If the input cannot be parsed, the tool reports the error and shows nothing, so a successful output means the JSON is valid.

What indent does pretty mode use?

Two spaces per level. That is the most common convention for readable JSON and works well in version control diffs.

Does formatting change my data?

No. Formatting and minifying only change whitespace. Keys, values, ordering, and types are preserved exactly.

Can I minify to shrink a payload?

Yes. Minify removes all unnecessary whitespace, which reduces size when you send JSON over a network or store it.