JSON Formatter
JSON → JSONIndent, minify or sort a JSON document, and point at the line that broke it.
Formatted JSON appears hereAbout JSON Formatter
Paste JSON and it is reformatted as you type — indented two or four spaces, indented with tabs, minified onto a single line, or with every key sorted alphabetically at every level. Sorting is the quiet useful one: run it on two payloads and a diff between them stops being full of noise from reordered keys.
When the document does not parse, the error names the line and column rather than a character offset, so you can go straight to the problem in a payload thousands of lines long. The readout under the output pane counts array items, object keys, total nodes, and nesting depth, which answers “how many records came back” without scrolling.
Everything happens in this browser tab. The JSON never reaches a server, which matters when the thing you are debugging is a production API response with real customer data in it.
Common questions
- Is my JSON uploaded anywhere?
- No. The page is static and the formatting runs in JavaScript on your machine. You can open your browser's network tab, format a document, and watch that no request is made — or disconnect from the internet and keep using the page.
- Why is valid-looking JSON rejected?
- The strict JSON grammar has no trailing commas, no comments, no single-quoted strings, and no unquoted keys. Those are all legal in a JavaScript object literal, which is where the confusion usually comes from. The error message points at the exact character that broke the parse.
- What does sorting keys do to arrays?
- Nothing — array order is meaningful data, so it is preserved exactly. Only object keys are reordered, and it applies at every level of nesting.
- How large a document can it handle?
- Several megabytes is comfortable on a normal machine. The limit is your browser's memory rather than any restriction here, and because nothing is uploaded there is no file size cap to work around.
This page does the work itself, in this tab. Nothing you paste is sent to a server. Close the tab and no copy remains.