How to use
Use this tool to validate and format JSON safely in your browser.
- Paste your JSON into the input box.
- Choose Indent (2, 4, or tab) and optionally enable Sort keys.
- Click Validate + Pretty or Minify.
- If invalid, read the error and jump to the reported position.
- Copy the formatted output when it looks right.
FAQ
Is my JSON uploaded to a server?
No. The validator runs locally in your browser; nothing is sent over the network.
Why does it say “Invalid JSON” when it looks close to correct?
JSON is strict: keys and strings must use double quotes, and trailing commas are not allowed.
Can it show the exact error location?
Yes when the browser provides an error position; the tool converts it to line/column and shows a snippet with a caret.
What does “Sort keys” do?
It recursively sorts object keys alphabetically to produce stable, diff-friendly output; array order is preserved.
Does minify change the JSON meaning?
No. Minify only removes whitespace; the parsed value stays the same.
Can it validate top-level values like numbers or strings?
Yes. Valid JSON can be an object, array, string, number, true/false, or null.
Why did key order change after formatting?
If “Sort keys” is enabled, key order is intentionally rearranged; otherwise order usually follows the parsed object’s insertion order.