JSON Formatter / Validator
Format and validate JSON — with the error pinned to a line and column.
What you paste
Parsed in your browser — never uploadedHow 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.
Put this on your own site
Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.
<iframe src="https://runthetests.com/embed/json-formatter/" width="100%" height="720" style="border:1px solid #e5e5e5;border-radius:8px" title="JSON Formatter / Validator" loading="lazy"></iframe>
Preview it at https://runthetests.com/embed/json-formatter/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.
More in DevOps
- API Rate Limit CalculatorSize a request rate that fits inside a quota, retries included.
- X.509 Certificate DecoderDecode a PEM certificate and read every field it carries.
- CSV to JSON ConverterConvert CSV to JSON without destroying your identifiers.
- cURL Command BuilderAssemble a curl command with the shell quoting done properly.
- cURL Command ParserRead a curl command back in plain terms, and convert it to fetch or Python.
- Diff / Text CompareCompare two blocks of text and see exactly what changed.