JSON Minifier
Strip whitespace from JSON to shrink payloads. Shows the size saved.
Why minify JSON
Indented JSON is easy to read but every space and newline is a byte on the wire. Minifying a typical pretty-printed API response shaves 20 to 40 percent off its size before gzip, which matters for mobile clients, edge caches, message queues with payload limits and configuration embedded in environment variables. Press Minify (or ⌘⇧M) and the status bar shows the size before and after.
What minification changes, and what it does not
- Removes all whitespace outside of strings: spaces, tabs and newlines.
- Leaves every string, number, boolean and null exactly as written.
- Preserves the order of keys, so the minified output is byte-for-byte stable for the same input.
- Refuses invalid input instead of guessing. Fix the reported error, then minify.
Like every tool on TheJSON, this runs entirely in your browser. Nothing you paste is uploaded, logged or stored on a server, so it is safe to use with API responses that contain tokens or customer data.
Frequently asked questions
Is minifying JSON safe?
- Yes. Minification only removes whitespace between tokens, which has no meaning in JSON. Whitespace inside string values is untouched, so the minified document parses to exactly the same data.
How much smaller does JSON get when minified?
- It depends on nesting depth and indentation. Two-space indented documents typically shrink by 20 to 30 percent, four-space documents by 30 to 40 percent. After gzip the difference is smaller but not zero.
Does the minifier remove comments from JSON?
- Standard JSON has no comments, so a document containing them is invalid and the validator will point to the first one. Remove the comments, or keep them in a JSON5 or JSONC file that your tooling understands.