JSON Minifier
Remove all whitespace from JSON to produce the smallest valid representation. Instantly see original size, minified size, bytes saved, and percentage reduction. Runs entirely in your browser.
Validate and minify JSON by parsing it and serializing it again without indentation. The tool also shows the original byte size, minified byte size, bytes saved, and approximate percentage reduction.
How to minify JSON
- Paste valid JSON into the input box.
- Let the tool parse and minify the content automatically or press Minify.
- Review any validation error if the JSON is invalid.
- Check the before-and-after byte statistics.
- Copy the compact JSON output.
What minification actually does
The tool uses JSON.parse followed by JSON.stringify with no indentation, so the result is a normalized JSON serialization rather than a blind whitespace remover. Whitespace outside string values is removed while string contents are preserved according to JSON parsing rules.
Size statistics are calculated with Blob byte sizes for the trimmed input and the resulting compact JSON. Because the text is parsed and serialized, invalid JSON is rejected instead of being partially compressed.
Privacy and limitations
Validation, minification, and size calculation happen locally in the browser and the JSON is not intentionally uploaded. This is a JSON serializer, not a JavaScript minifier: comments, trailing commas, undefined values, functions, or other non-JSON syntax are rejected by JSON.parse.
Frequently asked questions
Does it only remove spaces?
No. It parses the JSON and serializes the resulting value again in compact form.
Will spaces inside JSON string values be removed?
No. String contents are preserved as data.
Does it validate JSON?
Yes. Invalid JSON produces an error and no minified output.
How is the saved percentage calculated?
It compares the Blob byte size of the trimmed input with the compact output.
Can it minify JavaScript objects with comments?
No. The input must be valid JSON accepted by JSON.parse.