JSON Formatter and Validator
Pretty-print, validate or minify JSON in one click — nothing you paste leaves your browser.
How to format or validate JSON
- Paste your JSON into the box, or type it directly.
- Pick an indent — two spaces, four spaces or a tab.
- Press Format and validate. Valid JSON comes back as a clean, readable document; invalid JSON comes back as an error naming the line and column.
- Copy the result or download it as a
.jsonfile.
Minify does the opposite: it strips the indentation back out so the payload is as small as possible, which is what you want when the JSON is going over the wire rather than being read by a person.
Why JSON breaks, and what a formatter tells you
JSON looks like JavaScript, which is exactly why it is so easy to get wrong. It is a far stricter format than it appears: keys and strings must use double quotes, and there are no comments, no trailing commas and no undefined. A file a JavaScript engine will happily accept can be rejected by every other language that parses JSON — which is usually the moment an API returns a 400 and the payload looks, at a glance, completely fine.
That is what re-indenting a document is for. Once every brace and bracket sits in a visible column, a missing comma or an unclosed object stops hiding inside one long line. This tool goes further and names the exact line and column where parsing failed, which is normally enough to find the fault immediately.
Minifying is the same operation in reverse. Because real-world JSON is deeply nested, indentation can easily double the size of a payload; on a busy endpoint that is bandwidth you pay for and latency your users feel. Minified and pretty-printed JSON hold exactly the same data — the difference is entirely for the reader.
JSON formatting FAQ
Is my JSON uploaded anywhere?
No. The formatter is plain JavaScript running in your browser tab. The text you paste is never sent to a server, logged or stored.
What does minifying do?
Minifying removes every space, tab and line break that JSON does not need, so the payload is smaller. The data itself is unchanged.
Why does my JSON fail to parse?
The usual causes are a trailing comma before a closing brace or bracket, keys or strings wrapped in single quotes, an unquoted key, a comment, and values such as NaN or undefined. JSON only allows double-quoted strings, no comments and no trailing commas.
How large a file can it handle?
Anything your browser can comfortably hold in memory. A few megabytes formats instantly; very large documents are limited by your device rather than by the tool.
Related tools
- Base64 Encoder and Decoder — encode a JSON payload so it can travel in a header or a URL.
- URL Encoder and Decoder — escape a JSON string that has to survive a query parameter.
- SHA Hash Generator — produce a checksum for a payload or a file.
- All developer tools — eight browser-based utilities.