JSON Formatter

Beautify, minify, and validate your JSON

Copied to clipboard!

About this tool

Paste JSON and get it back beautified with consistent indentation, syntax highlighting, and a collapsible tree view — or minified to a single line for compact storage. The formatter also validates as it parses, pointing you at the first syntax error instead of a silent failure.

Formatting happens locally in your browser, so API responses, config files, and payloads containing sensitive data never leave your machine.

When to use it

Worked example

Paste {"user":{"id":42,"name":"Ada","roles":["admin","dev"]}} and format it. You get each key on its own line with two-space indentation, and the tree view lets you collapse the roles array. If you had typed a trailing comma after "dev", the validator would flag it — trailing commas are legal in JavaScript but not in JSON, and they are the single most common reason a payload that "looks fine" fails to parse.

Frequently asked questions

Why is my JSON invalid when it works in JavaScript?

JSON is stricter than JavaScript object literals: keys must be double-quoted, strings must use double quotes, and trailing commas, comments, and undefined are all forbidden. The validator applies the real JSON spec, which is what servers and parsers enforce.

Is it safe to paste JSON containing API keys or personal data?

The formatter runs entirely in your browser — nothing is transmitted or stored. That said, treat any pasted secret with normal care: this page doesn't keep it, but your clipboard history might.

What's the difference between beautify and minify?

Beautify adds line breaks and indentation for human reading. Minify strips all insignificant whitespace to produce the smallest equivalent document — same data, different formatting. Round-tripping between them never changes the content.

Can it handle large files?

Yes, within browser memory limits — documents of several megabytes format fine. For very large files (hundreds of MB), a command-line tool like jq is the better fit.