JSON Formatter & Validator
Beautify, minify, validate with exact error lines, tree view — and upload .json files.
Text & dev tools
Drop a .json file here or browse
Up to 10 MB — read locally, never uploaded.
Recursively sorts every object's keys.
JSON is stricter than JavaScript — no trailing commas, no comments, no single quotes. The validator pinpoints the exact line and column when something's off.
JSON Formatter — FAQ
Why does my JSON fail when JavaScript accepts it?
JSON is a strict data format: no trailing commas, no comments (// or /* */), no single quotes, no unquoted keys, no NaN/undefined. JavaScript objects are more permissive than the JSON they serialize to — that's usually the gap.
Does the file upload send my data anywhere?
No. The file is read with the browser's FileReader API straight into the textarea. Nothing leaves your machine — same as typing it yourself.
What does "sort keys" do to arrays?
Nothing — array order is preserved (it's meaningful). Only object keys are alphabetized, recursively at every nesting level. Useful for comparing two API responses that list keys in different orders.
How big a file can it handle?
Up to 10 MB upload, and the formatter will handle most files that size on a desktop. Very deep trees (500+ levels) are capped in the tree view for rendering speed, but beautify/minify still work on the full data.
JSON vs JSONP vs JSON5?
JSON is the strict standard. JSONP wraps it in a function call for old-school cross-origin loading. JSON5 relaxes the rules (comments, trailing commas) — this tool validates standard JSON only, which is what APIs and config files expect.