Developer ToolsRuns offline

JSON Formatter & Validator

Paste JSON to reformat, minify or validate it. Errors are reported with the line and column where parsing failed, which is usually a few characters before where you think the problem is.

JSON Input

Everything runs in your browser — the text never leaves your device.

0 characters
STATUS
Waiting for input
Paste or type JSON on the left.
Top-level type
Keys / items
Maximum depth
Formatted size
Minified size
Saved by minifying
Share & embed

The five things that break JSON

Almost every invalid JSON document fails for one of the same handful of reasons. Trailing commas after the last element — legal in JavaScript, illegal in JSON. Single quotes instead of double quotes. Unquoted keys, which JavaScript object literals allow but JSON does not. Comments, which JSON has never supported. And unescaped control characters or raw line breaks inside strings.

The error message tells you where the parser gave up, which is not always where the mistake is. A missing closing brace early in a large document often reports an error at the very last character, because everything until then was still potentially valid.

Why this runs entirely in your browser

JSON payloads routinely contain API keys, customer records, internal identifiers and access tokens. Pasting those into a tool that posts them to a server is a data-handling incident waiting to happen, and a surprising number of online formatters do exactly that. This page parses with the browser's own built-in JSON engine — nothing is transmitted, and the page works with the network disconnected.

Minifying is not compression

Stripping whitespace typically cuts a formatted document by twenty to forty percent, which looks impressive until you remember that gzip or brotli on the wire would have removed most of that anyway. Minify JSON for embedding in a file or a database column where transport compression does not apply; do not bother for API responses that are already compressed in transit.

Sorting keys

JSON objects are formally unordered, so sorting keys alphabetically changes nothing semantically. It is enormously useful when you are diffing two documents that were generated by different systems, since it removes the noise of arbitrary key ordering and leaves only real differences.

Frequently Asked Questions

Why does my JSON fail with a trailing comma?
JavaScript allows a comma after the last element of an array or object, but the JSON specification does not. This is the single most common cause of a document that looks fine to a developer but fails to parse.
Can I use single quotes or comments in JSON?
No. JSON requires double quotes around both keys and string values, and has no comment syntax at all. Both are valid JavaScript but neither is valid JSON.
Is my data sent to a server?
No. Parsing and formatting happen entirely in your browser using its built-in JSON engine. The page continues to work with the network disconnected, which you can verify yourself.
Does the reported error position point at the real mistake?
Not always. The parser reports where it could no longer continue. A missing closing brace early in a document is often only detected at the very end, so check the structure above the reported position too.