Free JSON Formatter & Validator

Pretty-print, minify, and validate JSON — free, no sign-up, nothing leaves your browser.

JSON's stricter-than-JavaScript rules

JSON looks almost identical to a JavaScript object literal, which is exactly why it trips people up — it's actually a separate, stricter format. Property names must always be in double quotes, never single quotes or unquoted; trailing commas after the last item in an array or object aren't allowed, unlike in modern JavaScript; and comments have no place in the spec at all, so a config file with helpful // notes isn't technically valid JSON even if some tools are lenient enough to accept it. Because JSON is used as a data interchange format between many different languages and systems, not just JavaScript, this strictness is intentional — it keeps the format unambiguous regardless of what's reading or writing it.

Frequently asked questions

What does "minify" do?

Removes all unnecessary whitespace and line breaks, producing the smallest valid representation of the same data — useful for reducing file size before sending or storing JSON.

Why does it say my JSON is invalid?

Common causes are trailing commas, single quotes instead of double quotes, unquoted property names, or a missing bracket/brace — the error message shown comes directly from your browser's JSON parser and usually points to roughly where the problem is.

Can JSON have comments?

No — the JSON specification doesn't include comments at all. If you're working with a config file that has comments (like some VS Code settings files), that's a JSON-like superset format such as JSONC, not standard JSON, and this tool will flag it as invalid.

What's the difference between an object and an array in JSON?

An object (in curly braces { }) holds key-value pairs, like a labeled record. An array (in square brackets [ ]) holds an ordered list of values with no labels, accessed by position instead of name. JSON documents can nest either inside the other to any depth.

Is my data sent anywhere?

No. Everything is parsed and formatted locally in your browser — nothing you enter is sent to a server.