Free tool · runs in your browser
JSON Formatter & Validator
Clean up a JSON payload, shrink it for transport, or find out why an API response will not parse. Nothing is uploaded.
What makes JSON valid
Strict JSON allows double-quoted strings, numbers, booleans, null, arrays and objects, with exactly one value at the root. It does not allow trailing commas, comments, single-quoted strings or unquoted keys. A UTF-8 byte-order mark at the start can also break parsers even though the text looks fine.
Common failures are a trailing comma after the last property, a missing closing bracket, and a control character inside a string. The validator reports the parser message so you can jump to the problem.
Format or minify?
Formatting with two spaces makes diffs readable and is the right choice for config files and code review. Minifying removes insignificant whitespace and is useful when the payload is sent over the wire, but gzip already removes most of that benefit on modern HTTP connections.
Keep the readable version in version control. Minify at build or deploy time rather than editing a minified file by hand.
Do not paste secrets into random websites
This tool parses locally, but a browser tab is still a shared surface on a shared machine. Avoid pasting production credentials, private keys or customer data into any online form. For automated validation and formatting in a pipeline, use jq or a schema validator in CI.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing, formatting and minifying use the browser's built-in JSON parser on your device.
Why is my JSON invalid when it looks fine?
Look for a trailing comma, a comment, single quotes around a key or string, an unquoted key, or a byte-order mark. These are the most common causes.
Does it support JSON5 or comments?
No. It validates strict JSON, the format APIs actually accept. Comments and trailing commas are rejected by design.
Can I format a very large JSON file?
The parser runs in the page, so very large files can be slow or exhaust memory. For multi-megabyte payloads, use a command-line tool.
Can I use this to inspect an API response?
Yes. Paste the response body and format it. For repeatable checks, validate responses in code with a JSON schema instead.