{ }jsonkit
Format
Validate
Convert
Query
Generate

JSON formatter and beautifier

Beautify or minify JSON with 2 spaces, 4 spaces or tabs.
Indent
219 B · paste or drop a file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
✓ complete219 B → 219 B0.0 ms

About JSON Formatter

This JSON formatter pretty-prints minified or messy JSON with 2-space, 4-space or tab indentation. Paste an API response, a config file or a log line and read the structure at a glance.

Flip the Minify toggle to collapse it back to one line. Invalid input gets an error with the line and column of the first problem.

Runs in your browser. Nothing is uploaded, and it keeps working offline.

How it works

Indentation: 2, 4 or tabs

Pick 2 spaces, 4 spaces or tabs. The output updates as soon as you switch. Two spaces matches Prettier and most linters and keeps diffs small.

Minify with one toggle

The Minify switch removes every space and newline between tokens and puts the whole document on one line. Use it for request bodies or anything you ship over the wire. Switch it off to get the readable version back.

Strict parsing, precise errors

The formatter uses the browser's native JSON.parse, so it follows RFC 8259 strictly. Comments, trailing commas and single quotes are errors. You get the parser message plus the line and column of the first problem.

What changes and what does not

Formatting only changes whitespace. Values and key order come out as they went in, with two exceptions from how JavaScript parses JSON. Integer-like keys such as "10" are listed first, and integers above Number.MAX_SAFE_INTEGER lose precision. Escapes like \u00e9 are written out as the actual character.

Frequently asked questions

Is it safe to paste production JSON here?

Yes. Formatting runs in your browser and the JSON is never sent anywhere. You can disconnect from the internet and the tool still works.

What indentation should I use, 2 or 4 spaces?

Two spaces is the safest default. It matches Prettier and most linters and keeps diffs compact. Use 4 spaces or tabs if your style guide asks for them.

Why does it say my JSON is invalid?

The formatter parses strictly per RFC 8259. Trailing commas, comments and single-quoted keys or strings are rejected. The error points to the line and column of the first problem.

Does formatting change my data?

Only the whitespace changes in normal documents. Two edge cases come from JavaScript's parser. Integer-like keys move to the front of their object, and integers larger than 2^53 lose precision.

Is there a file-size limit?

There is no set limit. Very large files (tens of megabytes) depend on your device's memory because everything runs in the tab. Typical API responses and config files format right away.

Sources & last verified

We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.

Found a wrong result or an outdated claim? Report an error and we will check it again.