JSON Formatter
Format, validate & explore as a tree
Formatted JSON appears herePaste raw, minified, or messy JSON and instantly format it with proper indentation, validate its syntax with precise error locations, or explore it as a collapsible tree — all processed locally in your browser, so private API responses or config files never touch a server. JSON (JavaScript Object Notation) is the standard data-interchange format for REST APIs, config files, and NoSQL databases; a misplaced comma or unescaped quote anywhere in a large payload can be hard to spot by eye, which is what a dedicated formatter and validator are for. This tool also supports one-click minification (stripping whitespace for production payloads) and a tree view for jumping directly to a deeply nested key without scrolling through thousands of lines.
Why does my JSON fail to parse even though it looks correct?
The most common causes are trailing commas after the last item in an object/array (not allowed in strict JSON, unlike JavaScript object literals), single quotes instead of double quotes around keys/strings, unquoted keys, or a stray comment (`//` or `/* */`) — JSON has no comment syntax at all. This formatter's validator points to the exact line and column of the first syntax error.
What's the difference between formatting and minifying JSON?
Formatting ("pretty-printing") adds indentation and line breaks so humans can read the structure. Minifying strips all unnecessary whitespace to produce the smallest possible payload — used in production APIs to save bandwidth. Both represent identical data; only the text representation differs.
Is it safe to format JSON containing API keys or personal data here?
Yes — formatting, validation, and the tree view all run entirely in your browser via JavaScript's built-in `JSON.parse`; nothing is sent to a server at any point, which matters for pasting real production payloads or credentials during debugging.