JSON formatter & validator — offline
Pretty-print, minify, and validate JSON without your data ever leaving the browser. Error positions included.
Format and validate JSON without uploading it
The JSON developers actually need to format is rarely a toy example. It is a captured API response, a config file, a webhook payload, a log line — and those routinely contain bearer tokens, session identifiers, internal hostnames, email addresses, and real customer records. Pasting that into an online formatter sends all of it to a server you have no relationship with, to solve a problem that is pure string manipulation.
Parsing and formatting here use your browser's own built-in JSON engine. Nothing is transmitted, because this site is static files with no backend, and a Content-Security-Policy blocks third-party requests. Load the page, disconnect from the network, and it still works — which is the point.
Validation with the exact error position
The validator tells you whether the input is valid JSON and, for most syntax errors, the exact line and column of the problem — so you go straight to the character at fault instead of hunting through a wall of minified text.
The usual culprits are worth knowing by sight: a trailing comma after the last element (legal in JavaScript, illegal in JSON), single quotes instead of double quotes, unquoted object keys, an unescaped newline or quote inside a string, and stray comments — JSON has no comment syntax at all, which surprises people editing config files. A truncated response that simply stops mid-structure is the other common one.
Minify, indent, and sort keys
Pretty-printing with your choice of indent makes a payload readable. Minifying strips every unnecessary byte for the opposite case — pasting into an environment variable, a single-line config field, or anywhere size matters.
Sort keys is the option worth knowing about. It sorts object keys alphabetically at every depth, which makes two JSON documents genuinely comparable: without it, the same data serialised by two different services produces a diff full of moved lines that changed nothing. Sort both, then compare them in the diff checker and only the real differences remain.
Related, all client-side: JSON to YAML or TOML, CSV to JSON, and the JWT decoder when the JSON you are staring at is a token payload.
How to format and validate JSON offline
- 1
Paste JSON (or drop a .json file) into the input.
- 2
Pick an indent style, optionally sort keys.
- 3
Format or minify — then copy the result.
JSON Formatter — frequently asked questions
Is my JSON sent to a server to be formatted?
No. Parsing and formatting use your browser's built-in JSON engine — the data never leaves this page. API responses with tokens or customer data stay on your machine.
What does the validator report?
Whether the input is valid JSON, and for many syntax errors the exact line and column, so you can jump straight to the problem.
Can it sort object keys?
Yes — enable "Sort keys" to sort all object keys alphabetically at every depth, which makes diffs between two JSON documents much easier to read.