JSON Formatter & Validator
Pretty-print, minify and validate JSON with line-accurate error messages.
Format and validate JSON, instantly
JSON is ubiquitous — APIs, config files, logs, databases all speak it — but a single misplaced comma can make a whole response unparseable. This formatter re-indents valid JSON and tells you exactly where invalid JSON breaks.
Three modes
- Format (pretty-print). Re-indents the input for readability. Useful when diffing two API responses, or preparing an example for documentation.
- Minify. Removes every optional whitespace character. Useful for embedding JSON in URLs, reducing request body size, or storing in a single column of a database.
- Validate. If the input isn’t valid JSON, the tool surfaces the parser’s error message with the position of the problem.
Common syntax errors
- Trailing commas.
[1, 2, 3,]is valid in JavaScript but not in strict JSON. - Unquoted keys.
{name: "Alice"}is valid in JavaScript, invalid in JSON. Keys must be double-quoted. - Single quotes. JSON only accepts double quotes.
- Comments. JSON has no comment syntax. If your file uses them, it is JSONC or JSON5, not JSON.
Privacy
Everything runs in your browser. Your JSON — which may contain API keys, internal URLs or personal data — never leaves the device.
Frequently asked questions
- What counts as valid JSON?
- Strict JSON (RFC 8259). That means: double-quoted keys and strings, no trailing commas, no comments, and `true`/`false`/`null` in lowercase. If your data comes from a JavaScript source, it may contain any of these non-standard features — this validator will flag them.
- Can I format a JSON file with millions of entries?
- The formatter runs entirely in your browser's memory, so there is no server limit — you are bounded by your device's RAM. Most modern browsers can comfortably format 50+ MB of JSON.
- Which is better: 2-space or 4-space indentation?
- 2 spaces is the convention for most JSON ecosystems today (npm `package.json`, most web APIs, many config files). Choose 4 spaces only when a downstream tool or team style guide demands it.