How to validate, minify, and compare JSON
Check syntax, strip whitespace, or diff two documents in the browser — without treating minify as a validator or a tree diff as a text diff.
Valid means parseable, not pretty
JSON Validator at /tools/json-validator runs JSON.parse on what you paste and reports Yes or No plus the root type (object, array, string, number, boolean, or null). A syntax error includes the parser message; trailing commas, unquoted keys, and single quotes fail. Pretty-print is a separate job: JSON Formatter at /tools/json-formatter rewrites valid input with indent and optional sorted keys. Use the validator when you only need a pass/fail before shipping a payload, not a rewritten file.
Minify is not encryption
JSON Minifier at /tools/json-minifier removes insignificant whitespace from valid JSON so a payload is smaller on the wire. It still has to parse first — invalid JSON is rejected rather than “compressed.” Minifying does not hide secrets. Example: { "a": 1, "b": [2, 3] } becomes {"a":1,"b":[2,3]}. The formatter’s Minify control on the same pretty-print page does the same rewrite; the dedicated minifier exists for people who search for that name. Convert to TypeScript is a sibling when you need interfaces, not smaller JSON.
Compare two documents, not two strings
JSON Compare at /tools/json-compare parses JSON A and JSON B, then shows added, removed, and changed values in the tree. Key order and extra spaces do not count as a difference after parse. Text Diff at /tools/text-diff is line-oriented and will flag indent-only changes. Both sides must be valid JSON; an error names which pane failed. Use this for two API dumps or two config files, not for a regex hunt (that is Regex Tester).
Worked example
Paste {"ok": true, "n": 1} into the validator — valid, type object. Change it to {ok: true} (unquoted key) and the page reports invalid with a parse error. Minify the valid object to one line for a log. Compare {"n":1} with {"n":2} — n is modified, nothing added. Compare {"n":1} with {"n":1,"x":0} — x is added. Nothing is uploaded. Close the tab to drop production payloads.
When to use which JSON page
Formatter: read nested data. Minifier: compact a valid document. Validator: syntax only. Compare: two documents. JSON → TypeScript: generate interfaces. Fake JSON: sample fixtures. YAML ↔ JSON and XML ↔ JSON when the other side is not JSON. Fake and converters still require valid structure after conversion.
Privacy
All three tools run in this tab. Do not paste live customer PII on a shared machine. Related: JSON Formatter for pretty-print, JSON → TypeScript for types, Text Diff when the files are not JSON.