AnyFormat

00 Utility

JSON Formatter

Format, validate and minify. Errors point at the line.

01Input
02Output
03Options 3
  • No upload The conversion runs in this tab. Your file never travels — not to us, and not to the advertising.
  • No sign-up, no email, no daily cap There is no account system to sign up to.
  • No size limit we invented Only your device's memory — about ~2 GB on a desktop browser, ~400 MB on a phone.
  • Turn your Wi-Fi off and convert anyway The conversion needs nothing but this page. Ads will not load without a connection; your file will still convert. That is the whole claim, and it takes five seconds to check.

Paste JSON to format it, check it or squeeze it flat. The reason to use a tool that runs locally is simple: the JSON people most need to format is an API response or a log line from production, and pasting that into a website is exactly the thing your security policy forbids.

Errors that tell you what is wrong

"Unexpected token } in JSON at position 412" is technically accurate and practically useless. Every error here comes with the line and column, a quotation of the surrounding text, and a guess at the actual mistake — trailing comma, single quotes, an unquoted key, comments, a truncated file, or XML pasted by accident.

Those six account for the overwhelming majority of malformed JSON. The remaining cases fall back to the position and the excerpt, which is still enough to find it.

What the statistics are for

Alongside the formatted output you get the node count, the maximum nesting depth and a breakdown by type. Depth is the useful one: a document nested twelve levels deep is usually a sign that something is being serialised that should not be, and it is the first thing to check when a parser somewhere downstream is running out of stack.

Sorting keys

Alphabetical key ordering makes two JSON documents comparable. If you are diffing an API response before and after a change, sort both first — otherwise you get a diff full of moved lines that changed nothing. Pair it with the diff checker.

Formatter, beautifier, validator, pretty-printer

All four words describe this page. Formatting and beautifying are the same operation; validating is the same parse without the output; pretty-printing is the same thing again. There is no reason to make you choose between four different pages for one job.

Other names for this

Also searched as “json beautifier”, “json pretty print”, “format json online”, “json parser”.

Questions

Can I format JSON with comments (JSONC)?
No. Comments make it a different format — JSONC or JSON5 — and this parser is strict, which is what makes it useful for checking whether a real parser will accept your file. Strip the comments first.
Is there a size limit?
No imposed limit. Very large documents (tens of megabytes) will make the browser sluggish because formatting is a synchronous operation, but they work. Drop the file rather than pasting it — the paste box gets slow long before the parser does.
Why does minifying save so much?
Indentation and newlines are typically 15–30% of a formatted JSON document. Over the wire that mostly disappears under gzip, but it matters for anything you are storing in a size-limited field.
Does my text leave the browser?
No. Everything runs as JavaScript in this tab — there is no server involved and no request is made. Open the Network panel and watch, or turn your Wi-Fi off and keep using the tool.