100% client-side · no sign-up

JSON formatter & beautifier

Beautify messy JSON into readable, indented text, minify it down for production, or sort keys alphabetically at every depth. Choose 2-space, 4-space, or tab indentation, and keep short primitive arrays compact instead of exploded one-per-line.

Indent
JSON
Drag & drop a .json file to import
Ready Lines: 0 Characters: 0

More control than a plain pretty-printer

JSON.stringify's built-in indent option is all-or-nothing. This formatter adds the controls real projects actually need.

Compact primitive arrays
Arrays containing only numbers, strings, or booleans stay on one line, while arrays of objects still expand — the readable middle ground plain JSON.stringify can't produce.
📑
Deep key sorting
Sort object keys alphabetically at every nesting level, making config files and API responses easier to scan and diff.
Custom indentation
Switch between 2 spaces, 4 spaces, or a tab character to match your project's style guide.
🔒
100% client-side
Formatting and minifying happen entirely in your browser — nothing you paste is ever uploaded to a server.

Frequently asked questions

What is the difference between beautify and minify?

Beautify adds indentation and line breaks so JSON is easy to read. Minify removes all unnecessary whitespace to produce the smallest possible payload, which is useful for APIs and file size.

What does "Compact arrays" do?

When enabled, arrays that contain only primitive values (numbers, strings, or booleans) are kept on a single line instead of one item per line, while objects and nested arrays are still expanded. This keeps short lists like coordinates or tags compact and readable.

Does Sort Keys change the order of array items?

No. Sort Keys only reorders object property names alphabetically at every nesting level. Array item order is always preserved.

Can I use a tab character for indentation?

Yes. The indent selector supports 2 spaces, 4 spaces, or a single tab character, applied consistently across every nested level.

More JSON tools