JSON Formatter
Paste JSON, get it formatted or minified, and find out exactly where it breaks if it is invalid. Everything happens in your browser, which matters when the payload you are debugging contains real customer data.
Runs entirely in your browser. Nothing you paste is uploaded.
Formatted JSON will appear here...
About the JSON Formatter
Validation uses the browser's native JSON.parse, so what you see here is precisely what your application will accept or reject. The error messages come straight from the JavaScript engine and include the character position of the failure.
The usual culprits in hand-written JSON are trailing commas after the last element, single quotes instead of double quotes, unquoted keys, and comments. All four are valid JavaScript and all four are invalid JSON.
Frequently asked questions
Is my JSON uploaded anywhere?
No. The parsing and formatting run in your browser with no network request. You can confirm it by opening devtools and watching the network tab, or by disconnecting entirely — the tool keeps working.
Why is my JSON invalid when it looks fine?
Almost always a trailing comma, a single-quoted string, an unquoted key, or a comment. JSON allows none of those even though JavaScript allows all of them.
Can it handle very large files?
Multi-megabyte documents are fine on a modern machine. Beyond roughly 50MB the browser tab will start to struggle, and a streaming parser like jq is the better tool.