JSON formatter & validator
Format, validate and minify JSON in your browser. Shows errors with line + column.
Paste JSON text, for example {"hello": "world"}. Formatting and checking run only in your browser.
How this tool works
The JSON formatter validates, pretty-prints and minifies arbitrary JSON code directly in the browser — no server transfer. It pinpoints syntax errors precisely (line + column), supports pretty-print with 2 or 4 spaces, a compact minified variant and alphabetical key sorting. For nested objects it reports depth and key count per level, plus size reduction from minification.
Typical use cases
- Turn a pasted API response into readable JSON
- Validate JSON body before a POST — prevents "400 Bad Request"
- Pretty-print config files (package.json, tsconfig.json)
- Minify JSON for embedded use to save bandwidth
- Sort keys alphabetically to make diffs easier to read
Frequently asked questions
Is my JSON input stored?
No, processing runs purely in the browser. Even sensitive JSON (API keys, tokens, personal data) does not leave your computer.
Does the formatter understand all JSON variants?
Standard RFC 8259 JSON yes. JSONC (with comments) and JSON5 (trailing commas, single quotes) are reported as syntax errors. For NDJSON (one JSON value per line) use the JSONL validator.
What happens with duplicate keys?
JSON.parse and most other parsers keep only the last value. The formatter warns with the path of every duplicate key and keeps both entries in the output so nothing is lost while formatting.
Are large numbers preserved when formatting?
Yes. Numbers and strings are copied character for character, including integers above 2^53 (such as 64-bit IDs) and decimals with many digits. Keys keep their order unless you choose sorting.
Is there an input size limit?
Up to ~10 MB is fine in-browser. Larger files should be processed with jq or Node.js.
Can you extract key paths?
Currently we show only depth and key count. Path extraction ($.user.email style) is on the roadmap.
Related tools
Continuous monitoring vs. one-shot?
XICTRAQ monitors uptime, SSL, security headers, GDPR and performance 24/7. Free plan, no credit card.