JSON Formatter
Runs entirely in your browser
Beautify or minify JSON directly in your browser. Paste your JSON, choose an action, and copy the result.
How to use JSON Formatter
- Paste your JSON into the Input box.
- Choose an indent size, then click Beautify, or click Minify.
- Copy the result from the Output box.
Features
- Beautify JSON with 2 or 4 spaces, or a tab.
- Minify JSON to the smallest possible size.
- Clear error messages with line and column details for invalid JSON.
- 100% client-side — your data never leaves your browser.
Example
This compact JSON:
{"name":"Toolbeel","tags":["free","fast"],"active":true}
becomes this after clicking Beautify with the default 2-space indent:
{
"name": "Toolbeel",
"tags": [
"free",
"fast"
],
"active": true
}
Clicking Minify on that same beautified JSON collapses it right back to {"name":"Toolbeel","tags":["free","fast"],"active":true}.
Tips
- Beautify and Minify both re-parse your JSON with
JSON.parseand re-serialize it, so numbers get renormalized —1.50becomes1.5, and a number written like0700is rejected instead of kept literally. - Duplicate keys aren't preserved: if the same key appears twice in your input, only the last value survives after formatting.
- The Tab option inserts one literal tab character per indent level, so the visual width of Beautify output depends on your editor's tab size, not a fixed number of spaces.
- Purely numeric keys, like
"2"or"10", get moved to the front of an object and sorted in ascending numeric order — that's standard JavaScript object-key ordering, not a bug in the formatter.
Is JSON Formatter safe?
Yes. Beautify and Minify both re-parse your JSON with JSON.parse and re-serialize it using local JavaScript, so nothing you paste ever reaches a server — just keep in mind that this renormalizes numbers and reorders purely numeric keys, so it's a formatting pass, not a byte-for-byte copy.
Frequently Asked Questions
What's the difference between Beautify and Minify?
Beautify adds line breaks and indentation to make JSON easy to read. Minify removes all unnecessary whitespace to make the JSON as small as possible.
Why would I minify JSON?
Smaller JSON means smaller API payloads, faster network transfer, and less storage for config files or cached responses. Minifying is purely cosmetic — it doesn't change what the data means.
What happens if my JSON is invalid?
You'll see an error message with the line and column where the problem was found, so you can fix it quickly.
Can I choose the indentation size?
Yes. Choose 2 spaces, 4 spaces or a tab character before clicking Beautify.