Developer
JSON Formatter & Validator
Paste JSON to pretty-print it, minify it, or find out exactly why it will not parse. Invalid input is reported with the precise line, column, and character offset plus a caret under the offending character, so you can jump straight to the missing comma or unquoted key. Choose 2-space, 4-space, or tab indentation, optionally sort object keys, and check the structure at a glance with the key, depth, and size summary. Everything runs in your browser — your JSON is never uploaded.
How to format JSON online
- Paste your JSON into the box above. It is validated as you type and the badge turns green the moment it parses.
- Pick an indentation style, then press Format — or hit Ctrl/Cmd + Enter from inside the editor.
- Press Minify instead to strip every space and line break for the smallest possible payload.
- Use Copy to take the result, or Sort keys A–Z first to make two objects easy to compare.
Finding the syntax error
When JSON will not parse, the tool reports the line, the column, and the character offset, and prints the offending line with a caret under the exact character. The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, a missing closing brace, or a stray comment — none of which the JSON specification allows, however common they are in JavaScript.
Minify or pretty-print?
Pretty-printing adds indentation and line breaks so a payload is readable in a diff, a code review, or a bug report. Minifying removes every byte that is not data, which is what you want for an API response, a config baked into a build, or anything that travels over the network. Both produce exactly the same data — only the whitespace changes.
Is it safe to paste sensitive JSON?
The parsing, formatting, and analysis all happen in your own browser with JavaScript. Nothing is uploaded, logged, or stored, so API responses containing tokens, customer records, or internal identifiers never leave your machine — you can even disconnect from the network and the page keeps working.
Frequently asked questions
Why does my JSON say invalid when it looks fine?
The most common causes are a trailing comma after the last item in an object or array, single quotes instead of double quotes, keys that are not wrapped in quotes, and JavaScript comments. All four are legal in JavaScript but rejected by the JSON specification. The error panel gives you the exact line and column so you can see which one it is.
Does the formatter change my data?
No. The JSON is parsed into real values and written back out, so only whitespace and key order change. Numbers, strings, booleans, nulls, and the nesting stay exactly as they were. The one thing to know is that duplicate keys in the same object collapse to the last one, because that is what every JSON parser does.
What does sorting keys do?
It reorders the keys of every object alphabetically, all the way down the tree. That makes two versions of the same payload directly comparable in a diff tool, since key order stops being a source of noise. Sorting has no effect on arrays, whose order is meaningful data.
How large a file can it handle?
Anything your browser can hold in memory — payloads of a few megabytes format in well under a second. Very large files are limited by the browser rather than the tool, and the byte size shown next to the result tells you what you are working with.
Is my JSON uploaded to a server?
No. Everything is parsed and formatted locally by your browser, so tokens, customer data, and internal identifiers in the payload never leave your device. The page keeps no history and works offline once it has loaded.