Free tool
JSON formatter & validator.
Paste an API response and read it again — indented the way you want, keys sorted if you want a clean diff, or minified back to one line. When it does not parse you get the line, the column, the character and a guess at which of the usual five mistakes it was.
Valid JSON · 17 keys · nested 4 levels deep
Publishes the formatted JSON to Comma: one URL instead of a paste that loses its indentation, readers comment on the exact line, and every re-publish is kept as a revision. Free, no card.
Where the error actually is
A parser reports the position where it gave up, which is usually a character or two after the mistake — the trailing comma is fine until the } arrives and proves it was not. So read the caret as "by here, something was already wrong" and look at the end of the previous line first. That single habit resolves most of them.
The five causes worth memorising: a trailing comma, single quotes instead of double, an unquoted key, True/False/None from a Python repr(), and a comment. None of the five are JSON, all five are legal somewhere else, and that is exactly why they keep arriving in files that were supposed to be JSON.
Sort keys before you diff
Two exports of the same object can differ byte for byte purely because the keys came out in a different order, and a diff will dutifully report every one of them. Sorting recursively first collapses that noise to the lines that really changed. Array order is left alone — in JSON that is data, not formatting. Once both sides are formatted the same way, the diff tool will show you the one field that moved.
When nobody wants to read the braces
Formatting makes JSON readable to someone who already reads JSON. If the audience is a person waiting on an answer, the payload wants to be a table — JSON to HTML table turns an array of records into columns in one paste. Published as a report, either form becomes a URL with comments anchored to the exact row and every re-publish kept as a revision you can diff. An agent can publish the same thing at the end of a run over the MCP server.
Questions
- How do I format JSON online?
- Paste the JSON into the editor or open a .json file. It is parsed and re-printed with two-space, four-space or tab indentation as you choose, with one value per line so nesting is readable. Copy the result or download it. Nothing installs and nothing is uploaded.
- How do I find the error in invalid JSON?
- Paste it. If it does not parse, the line and column are shown along with the offending line and a caret under the exact character, plus a plain-English guess at the cause — a trailing comma, single quotes, an unquoted key, a Python literal or a comment. Fix that character and the banner turns green.
- Is this a real validator?
- Yes, in the only sense that matters: it uses the same JSON.parse that every JavaScript runtime uses, so anything this page accepts will be accepted downstream and anything it rejects would have failed there too. It does not check your data against a JSON Schema — that is a different job.
- What does sorting keys do?
- It rewrites every object with its keys in alphabetical order, all the way down. Two exports of the same data then produce byte-identical files, which is what makes them worth diffing — otherwise a key that moved looks like a change. Array order is never touched, because in JSON that order is data.
- How do I minify JSON?
- Choose Minify. Every space and newline between tokens is dropped and the file comes back as one line, which is what you want in a request body or a config a machine reads. Whitespace inside string values is untouched — minifying is lossless and reversible by formatting again.
- Can it handle a large file?
- Files up to a few megabytes are fine; everything runs on your machine, so the limit is your browser's memory rather than an upload quota. Past that, format it locally with jq. If the point is to show the data to somebody, a table is a better destination than a wall of braces.
- Is my JSON uploaded anywhere?
- No. Parsing, formatting and validation all happen in this tab. The data only leaves your machine if you choose Get a shareable link, which publishes it as a Comma report whose access you control.
Related: JSON to HTML table · HTML formatter · URL encoder · all free tools · report types