JSON tools
JSON Formatter & Validator
Pretty-print messy JSON, minify it for production, or find out exactly why a payload is invalid — with the offending line highlighted instead of an unhelpful “Unexpected token”.
- Runs 100% in your browser
- No signup · No uploads
- Free, unlimited use
JSON input
Examples: API response · Broken JSON — ⌘/Ctrl + Enter converts · drop a file to load it · processed locally
Formatted JSON
Output is read-only. Use Copy, Download or Share to move it out.
How to use the json formatter tool
-
Paste minified or messy JSON
Drop it in the input pane. The formatter parses as you type and shows errors immediately.
-
Choose format or minify
Pick indentation (2 or 4 spaces) or switch to minify mode to strip every optional byte for production payloads. Sort keys when you want stable diffs.
-
Read the stats
The output panel reports keys, objects, arrays, maximum depth and byte size — handy for spotting accidental payload bloat before it ships.
What makes this one different
- Real error positions: line, column and a code excerpt for invalid JSON
- Minify mode with byte counts, for checking payload weight
- Deep statistics: keys, objects, arrays, depth, scalar counts
- Optional recursive key sorting for deterministic diffs
- All local — safe for tokens, customer data and internal payloads
Privacy by architecture: this page contains no analytics that receive your input, and the conversion code runs in your tab. You can disconnect from the network after loading and keep working.
JSON Formatter — frequently asked questions
What does “Unexpected token” mean?
It means the parser hit a character that cannot appear where it was found — commonly a trailing comma before a closing brace, single quotes instead of double quotes, or an unquoted key. This formatter shows the line and column so you can fix it in seconds.
Does it validate JSON or just format it?
Both. Formatting requires a successful parse, so if the output appears, the input was valid. Any structural problem shows up as an error with its location instead of silently producing wrong output.
How large a file can it handle?
Files of a few megabytes render instantly. For very large documents, browser memory is the practical limit rather than the formatter — a typical laptop handles tens of megabytes without trouble.
Can I sort JSON keys alphabetically?
Yes — enable “Sort keys” and keys are sorted recursively at every level. That makes files deterministic, so version control diffs only show real changes.
Is my JSON sent anywhere?
Never. Everything is parsed in your browser tab. You can even disconnect from the network after loading the page and the formatter keeps working.
Related tools
Searching for “json beautifier”, “json validator online”, “format json”? You are in the right place — browse all 19 tools.