DevRivet
Tools

JSON Formatter / Validator

Pretty-print, minify, and validate JSON instantly.

Your data stays in your browser. Nothing is uploaded to a server.

Why format or validate JSON?

JSON produced by APIs or config files is often minified or hard to scan. Pretty-printing adds consistent indentation so nested objects and arrays are easy to read, while minifying strips whitespace for a compact payload. Validation catches syntax mistakes — like trailing commas or missing quotes — before they break your application.

How to use this tool

Paste JSON into the input box, then click Format to pretty-print it, Minify to compact it, or Validate to check it without changing the output. If the JSON is invalid, the line and column of the problem are shown whenever the browser provides that information.

Example

Formatting this minified API response:

{"name":"DevRivet","tools":10,"private":true,"tags":["json","regex","hash"]}

produces JSON indented with 2 spaces:

{
  "name": "DevRivet",
  "tools": 10,
  "private": true,
  "tags": [
    "json",
    "regex",
    "hash"
  ]
}

Minify turns the formatted version back into the single line above.

Common error: trailing comma

{"name":"DevRivet","tools":10,} is invalid because JSON does not allow a comma before the closing brace. In Chrome the tool reports the problem at Line 1, Column 31 — the } right after the comma. The exact error wording comes from your browser's JSON engine, so it differs between browsers, and some browsers don't report a position. Remove the comma and the JSON validates.

FAQ

Is my JSON uploaded anywhere?

No. Formatting, minifying, and validation all run locally using your browser's built-in JSON engine.

Why does my JSON say invalid but looks fine?

Common causes are trailing commas, single quotes instead of double quotes, or unquoted property names — none of which are valid JSON, even though they're valid in JavaScript object literals.