Minify JSON by parsing valid JSON and serializing it without extra whitespace. Produces a single compact line suitable for HTTP bodies, embedded scripts, or size-sensitive storage.
When to use it
- Shrink config snippets before embedding in HTML
- Compare canonical forms of two JSON blobs
- Reduce copy-paste size for chat or tickets
Limitations
Numbers and key order may change representation after round-trip parse. Does not strip comments—JSON with comments will fail validation. Processing stays local; no upload occurs.
Example
Pretty-printed input:
{
"b": 2,
"a": 1
}
minifies to the compact line {"b":2,"a":1} (key order follows the parse result). Use that single line in HTTP request bodies or embedded <script> tags where extra whitespace only wastes bytes.