JSON Formatter

Pretty-print, validate and inspect JSON instantly — without sending it anywhere.

Runs on your deviceDeveloperWorkingNo account needed

What this tool does

JSON Formatter parses your input and then re-serialises it with consistent indentation. Because that is a real parse rather than a text reformat, anything that comes out the other side is valid strict JSON, and anything the parser rejects is reported with the line and column where it stopped.

The value is usually diagnostic. A minified API response is unreadable in a terminal; formatted, the shape of the object becomes obvious, missing fields stand out, and a stray trailing comma becomes a specific error instead of a vague failure somewhere in your code.

This runs in your browser, which matters more for JSON than for most formats. JSON payloads routinely carry access tokens, session identifiers, internal hostnames and personal data. Pasting one into a server-side formatter hands all of that to someone else's logs.

How to use it

  1. Paste your JSON. Drop it into the input box, or load the sample to see the expected shape. Minified, half-formatted and pretty-printed input all work.
  2. Choose your indentation. Two spaces, four spaces or a tab. Turn on Sort object keys when you want to diff two payloads that list their fields in different orders.
  3. Relax the parser if you need to. Accept comments and trailing commas (JSONC) is off by default; switch it on for tsconfig-style input. The output is strict JSON either way, so the comments are dropped rather than carried through.
  4. Read the result, or copy it. Valid input is re-indented in the output pane, with a summary of the top-level shape and the output size. Rejected input names the reason, the line and the column.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Reading an API response

Curl output arrives as one long line. Formatting it is the fastest way to see whether the field you expected is actually there.

Finding a syntax error

A trailing comma or an unquoted key can break a config file silently. The parser reports the exact line and column instead of failing at startup.

Comparing two payloads

Format both with Sort object keys enabled and the diff reflects real differences rather than key ordering.

Converting JSONC to JSON

A tsconfig or .jsonc file with comments can be read in tolerant mode and emitted as plain JSON that a strict parser will accept.

Questions

Does my JSON get uploaded?
No. Formatting happens in this browser tab. Nothing is transmitted, logged or stored, which is why this tool still works with the network disconnected.
Why does it reject JSON that looks fine?
Strict JSON is narrower than JavaScript object syntax: single-quoted strings, unquoted keys, NaN and Infinity are never accepted. Comments and trailing commas are rejected too unless you enable the JSONC option, which exists for exactly that case.
Does formatting change my data?
Almost never, but there is one real exception. Values are parsed into JavaScript numbers, so an integer larger than roughly 9,007,199,254,740,991 — a Snowflake ID, for instance — is rounded and comes back changed. The tool detects this and says so in the summary rather than hiding it, but it cannot preserve the original digits. Separately, JSON has no comments to keep, and duplicate keys collapse to the last occurrence.
Will very large files work?
Formatting happens in memory, so a few megabytes is comfortable and tens of megabytes may make the tab sluggish. There is no imposed limit — the constraint is your device.
What is the difference between formatting and validating?
Formatting includes validation — a document that cannot be parsed cannot be formatted. Use JSON Validator when you only want a verdict and a duplicate-key report, and JSON Minifier for the opposite operation.

Related tools