Paste messy or minified JSON and get clean, readable output with your choice of indentation. Errors name the exact line and column. Runs in your browser.
Waiting for input
Everything runs in your browser — nothing is uploaded.
Paste JSON to get started
Format, minify and inspect your JSON directly in the browser.
JSON Formatter runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
JSON is easy for machines to read and, once it has been minified or logged on a single line, genuinely painful for people. A formatter re-indents the document so its structure is visible again: one key per line, nesting expressed as indentation, arrays and objects you can actually follow.
This formatter uses your browser's own JSON parser. That means it accepts exactly what a browser or a server would accept — no more, no less — so if it parses here, it will parse in your code. When it does not parse, you get the line and column where the parser gave up, plus a note about the most likely cause.
Nothing is sent anywhere. The parsing, the re-indenting and the byte counting all happen on your device, which is what makes it safe to paste an API response that still has a token in it.
No. The JSON Formatter runs entirely in your browser using the native JSON parser. Your data never leaves your device, which makes it safe for API responses containing credentials, personal data or anything else confidential.
Two spaces, four spaces, or tabs. Two spaces is the default because it matches the convention used by most JavaScript, TypeScript and configuration tooling. You can also minify to a single line.
The most common causes are trailing commas after the last item in an object or array, single quotes instead of double quotes around keys and strings, unquoted keys, and comments — none of which are legal in strict JSON. The error message gives you the line and column where parsing stopped.
Yes. Enabling key sorting rewrites every object in the document with its keys in alphabetical order, recursively. This is useful for producing stable diffs between two JSON documents that contain the same data in a different order.
Yes. Switch the output from Format to Minify and the document is rewritten to a single line with every optional byte of whitespace removed. The output panel reports the size difference, so you can see exactly what you saved.
Yes, though above roughly 512 KB the tool stops reformatting on every keystroke and waits for you to press Format instead. Parsing happens on your device, and re-parsing a very large document on each character would make typing stutter. Files of a few megabytes format fine on a modern machine; extremely large ones may briefly freeze the tab while the browser works.
The tool shows the parser's message along with the line and column where parsing stopped, and — where it can tell — a note about the likely cause, such as a trailing comma or single quotes. Your input is left untouched so you can fix it in place. Malformed input never throws an error into the page.