JSON Formatter
Pretty-print, validate and inspect JSON instantly — without sending it anywhere.
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
- 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.
- 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.
- 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.
- 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?
Why does it reject JSON that looks fine?
Does formatting change my data?
Will very large files work?
What is the difference between formatting and validating?
Related tools
- Base64 Encoder Decoder — Encode and decode Base64 text and files.
- JWT Decoder — Inspect the header, payload and claims of a JWT.
- Hash Generator — Compute MD5, SHA-1, SHA-256 and SHA-512 digests.
- Regex Tester — Test patterns against sample text with live matches.
- Unix Timestamp Converter — Convert between epoch seconds and readable dates.
- QR Code Generator — Create a QR code for a link, text, Wi-Fi or vCard.