Waiting for JSON content
Start typing on the left or load one of the sample payloads to inspect it instantly.
Instantly clean, validate, and inspect web payloads
Start typing on the left or load one of the sample payloads to inspect it instantly.
Compress and minify JSON payloads online instantly onto a single line. Calculate real-time bandwidth savings and optimize API transmission sizes for production.
Every tool runs in your browser, so the JSON you paste never leaves your device.
Formatting, minifying, repairing, and the tree view all run on your device, so there are no uploads to wait on.
Syntax errors like unescaped quotes and trailing commas are flagged with their exact line and column.
What gets removed, how much smaller the payload gets, and where a minifier fits in a real workflow.
Minifying JSON removes the characters that exist only for human readability — the line breaks, indentation, and the spaces after colons and commas. The data itself is untouched. How much you save depends on how much whitespace was there to begin with: a heavily indented file can shrink noticeably, while an already-compact payload barely changes. The saving is simply the whitespace you remove as a share of the original size. On its own that helps, and when your server also applies gzip or Brotli compression, minified JSON compresses a little further.
// Formatted (112 bytes)
{
"id": 101,
"status": "active",
"roles": [
"admin",
"developer"
]
}
// Minified (52 bytes)
{"id":101,"status":"active","roles":["admin","developer"]}The one thing a minifier must never do is remove spaces that are inside string values — turning "John Smith" into "JohnSmith" would corrupt your data. PrettyJSON handles this by tracking whether it is currently inside a quoted string as it scans the text, so spaces inside strings are preserved while the structural whitespace around braces, brackets, colons, and commas is removed. Escaped quotes inside strings are handled correctly, so the output is always valid JSON with identical data.
Minified JSON is mainly useful when size matters: API responses, config bundled into a build, data cached in memory, or messages sent over a network. Smaller payloads mean a little less to transfer and store. A common pattern is to keep JSON readable in source control and minify it as part of a build or deploy step, so humans work with the formatted version and machines get the compact one. Because PrettyJSON runs in your browser, you can minify sensitive payloads without sending them anywhere.
Common questions and expert answers regarding this tool.
Minifying removes the whitespace that exists for readability — line breaks, indentation, and spaces between tokens — and puts the JSON on a single line. The data stays the same.
It depends entirely on how much whitespace the original had. A heavily indented file shrinks more; an already-compact one barely changes. The saving is the whitespace you remove as a share of the original size.
No. Only whitespace outside of string values is removed. Keys, values, data types, and the spaces inside strings are all preserved.