JSON Formatter
Paste JSON to pretty-print it, minify it, or find out exactly where it breaks. Formatting and validating are the same operation — the file either parses or it doesn't — so this does both at once.
Private by design: This tool runs entirely in your browser. Your JSON is parsed on your device using the browser's built-in JSON engine, never uploaded, never stored, and never evaluated as code. See how in-browser processing works.
How to format and check JSON
Paste your JSON into the left box, or load a .json file from your device.
Click Format & check to pretty-print it, or Minify to strip every space.
If it's invalid you get the line and column of the problem; if it's valid, copy or download the result.
Formatting and validating are the same step
A formatter has to parse your JSON before it can re-print it. If parsing succeeds the file is valid, and you get formatted output; if it fails, the parse error is the validation error. That's why this is one tool rather than two — a separate “validator” would run exactly the same check and tell you exactly the same thing.
Finding the actual error
Browser JSON errors are famously unhelpful on their own. This tool converts the parser's character offset into a line and column and shows you that line, so you can go straight to the problem instead of counting characters.
The usual culprits: a trailing comma after the last item, single quotes instead of double, an unquoted key, a missing closing brace, or a stray character pasted in from a chat window. JSON also rejects NaN, Infinity, and comments, all of which are legal in JavaScript — a common source of confusion.
Minifying, and when it matters
Minifying removes every space and newline the parser doesn't need. It typically cuts a formatted file by a third or more, which matters for API payloads and config shipped over the network, and not at all for a file you're reading. The data is identical either way — only the whitespace changes.
Safe for config files and API responses
JSON often carries credentials, tokens, customer records, or internal API shapes — exactly the things you shouldn't paste into a random website. Nothing here is uploaded: your text is parsed by the browser's own JSON engine on your device, and it's never sent anywhere, stored, or logged. The tool also never evaluates your input as code, so a hostile file can't do anything but fail to parse.
Good to know
Formatting and validating are one operation — valid JSON formats, invalid JSON reports the error.
Errors are reported by line and column, with the offending line shown.
Handles input up to 5 MB; larger files are better checked with a command-line tool.
Strict JSON: comments, trailing commas, NaN, and Infinity are all rejected, as the spec requires.
Your input is parsed on your device and never uploaded.
Frequently asked questions
Is this a JSON validator too?
Yes. Formatting requires parsing, so any file that formats successfully is valid. If it's invalid you get the parse error with the line and column instead of formatted output.
Why does my JSON say invalid when it looks fine?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, an unquoted key, or a missing brace. JSON also rejects comments, NaN, and Infinity even though JavaScript allows them.
Is my data uploaded anywhere?
No. Everything is parsed in your browser and never sent to a server, which matters when the file contains API keys or customer data.
What's the difference between formatting and minifying?
Formatting adds indentation and newlines so the structure is readable. Minifying strips all of it to make the file as small as possible. The data is identical — only whitespace differs.
How large a file can I check?
Up to 5 MB. Beyond that a browser text box becomes unwieldy, and a command-line tool like jq is a better fit.
Does it change my data?
No. It parses your JSON and re-prints the same values. Key order is preserved as written, and numbers and strings are unchanged.