RunTheTests

JSON Formatter / Validator

Format and validate JSON — with the error pinned to a line and column.

Parsed in your browser — never uploaded

How this reads your output

The tool parses your JSON with the browser’s built-in engine. If it is valid, it pretty-prints it with two-space indentation and reports the key count, nesting depth and minified size. If it is not, it turns the parser’s character position into a line and column and quotes the text around the error — so you can find it in a large file instead of hunting.

What the results mean

Line and column
Where the parser gave up. The real mistake is often just before this point — a missing comma on the previous line, for instance.
Max depth
How deeply the structure nests. Very deep JSON is harder to work with and sometimes a sign of a data-modelling problem.
Minified size
The JSON with all whitespace removed. Useful when you need to know the payload size for an API.

Common problems and fixes

My JSON is rejected but it looks fine
The usual culprits are a trailing comma after the last item, a comment (JSON has none), or single quotes instead of double. All are valid JavaScript but invalid JSON.
The error points at a line that looks correct
A JSON parser reports where it could not continue, which is often just after the real mistake. Check the line before the reported position for a missing comma or bracket.

Frequently asked questions

Why is my JSON with comments invalid?

The JSON standard does not allow comments — that was a deliberate design decision. Some tools accept a "JSONC" variant with comments, but strict JSON, which is what APIs expect, does not. Remove them, or the file will be rejected by any conforming parser.

Is my data sent to a server?

No. Parsing uses the browser’s own JSON engine and runs entirely on your device. Open your network panel while formatting and you will see no request carrying your data.

More in DevOps