← ALL TOOLS
// NETWORK & UTILITY · BROWSER

JSON Formatter/Validator

Pretty-print, minify and validate JSON, with the line and column of the first error.

NETWORK · IN YOUR BROWSER

Runs in your browser; nothing you type leaves this page. Too long to share as a link.

HISTORY

Your last 5 runs appear here for 7 days, on this device only.

RESULT

Fill in the form and run the tool; the result appears here.

JSON Formatter/Validator checks whether text is valid JSON and either pretty-prints it (2 spaces, 4 spaces or tabs) or minifies it to a single line, or only validates it, pointing to the exact line and column of the first error when it is not valid.

How to read the result

Valid input is shown reformatted as requested; invalid input shows the parse error with its position, which is almost always enough to spot a trailing comma, an unquoted key, or a missing bracket.

Defender tips

  • Validate and schema-check JSON at every trust boundary (an API request body, a config file loaded at startup) rather than assuming it is well-formed because it came from your own system; upstream bugs and manual edits both happen.
  • Do not hand-author complex JSON payloads without a formatter and validator in the loop; a single missing comma in a large document is easy to miss by eye and easy to catch with a parser.

FAQ

Does it accept JSON5 or JSON with comments?

No, it enforces strict JSON syntax as defined by the JSON specification; comments and trailing commas, which some relaxed formats allow, are reported as errors here.

Is there a size limit?

Yes: the input box takes up to 20,000 characters, which covers typical API payloads and config files. Everything runs in your browser.

Can it sort object keys?

No. Keys keep the order they have in your input. To compare two documents generated in a different key order, sort them with a tool such as jq -S first.