Prettify, minify, or validate JSON. All processing happens in your browser.
JSON · format · validate · minify
A free, privacy-first JSON formatter that pretty-prints, minifies, and validates JSON entirely in your browser. Paste an API response or config file, fix syntax issues, and copy clean output without uploading data to a third-party server.
JSON is the default interchange format for REST APIs, webhooks, package manifests, and many infrastructure configs. Humans rarely want the one-line minified form that travels over the wire. This tool rewrites valid JSON with consistent indentation so nested objects and arrays are readable, compresses it back to a single line when you need a smaller payload, and reports whether the input is legal JSON according to the language standard (not “JSON-like” JavaScript).
Under the hood it uses the browser’s native JSON.parse and JSON.stringify. That means the same rules your front-end and many runtimes use: double-quoted keys and strings, no trailing commas, no comments, and no bare undefined.
Ctrl+Enter formats from the input box.package.json, CI artifacts, or webhook fixtures before they break a pipeline.| Symptom | Likely cause | Fix |
|---|---|---|
Unexpected token ' | Single-quoted strings (JS, not JSON) | Use double quotes |
Unexpected token , | Trailing comma after last property/element | Remove the comma |
Unexpected token / or # | Comments (JSONC / JSON5) | Strip comments or use a JSONC-aware tool |
| Unexpected non-whitespace | Two values, or text after the root value | One root value only |
| Unexpected end of JSON | Truncated response or missing }/] | Complete the structure |
Tip: Formatting only changes whitespace (and may reorder object keys according to the engine). Values and types are preserved for valid JSON. It does not “fix” invalid input — validation fails until the text is legal JSON.
Minified input:
{"user":{"id":42,"roles":["admin","editor"]},"active":true}
Formatted output:
{
"user": {
"id": 42,
"roles": [
"admin",
"editor"
]
},
"active": true
}
Pretty-printing changes whitespace only. Number values stay numbers; strings stay strings. Key order may follow JSON.stringify rules in your browser.
Standard JSON forbids trailing commas. Many JS style guides allow them in object literals, but JSON.parse will reject them. Remove the extra comma or convert from JSONC separately.
No. Parse and stringify run locally in your browser. See our Privacy Policy.
Not as a multi-line stream in one pass. Format each line as its own JSON document, or use a dedicated NDJSON tool.