JSON Formatter & Validator
Validate, pretty-print, sort and minify JSON in your browser — with clear error messages and payload size stats.
Your JSON validation result
Paste some JSON to validate it, pretty-print it or minify it for production.
How it works
JSON is the language APIs speak. It's simple enough to read by eye, strict enough that one misplaced comma stops an entire integration, and just verbose enough that a real API response is unreadable until it's been formatted properly.
How it works
- Your text is parsed with the browser's native JSON engine — the same one your code uses.
- If it parses, it's valid, and it's re-serialised with your chosen indentation.
- If it fails, the parser's own error message is shown, usually pointing to the position of the problem.
- Minified output removes all optional whitespace for the smallest payload.
A worked example
A 40 KB API response pretty-printed at two spaces might minify to 28 KB — a 30% saving on every single request. On a busy endpoint that's real bandwidth and real load time, which is why production APIs never pretty-print and every developer tool does.
How to interpret your result
- Keys — total properties across the whole structure, a rough measure of payload complexity.
- Depth — how many levels of nesting. Beyond five or six, consider flattening for the sake of whoever consumes it.
- Minified size — what you'd actually transmit in production.
Common real-world uses
- Reading an API response while debugging an integration.
- Validating a config file before deploying it.
- Minifying payloads and fixtures for production.
- Sorting keys to make two versions of a file easy to diff.
- Checking webhook payloads from third-party services.
Related tools: Base64 Encoder / Decoder · URL Encoder / Decoder · UUID Generator · Unix Timestamp Converter