Squeeze any JSON to one line. Strips whitespace, removes comments, sorts keys and escapes non-ASCII. Stats bar shows bytes saved. Copy or download as .min.json.
Paste a JSON document and the minifier strips every byte of whitespace the spec does not require: indentation, blank lines, the space after each colon. The result is a single dense line ready for a network payload, a config embed, or a cache key. The lead sample, a service descriptor with nested objects and an array, compresses from 260 bytes to 204 bytes (21.5% reduction) without touching a single value.
Three toggles let you go further or stay safer. Strip comments (on by default) removes // line and /* block */ comments before parsing, which is the one thing standard JSON.parse refuses to do. Turn it off when your document has no comments and you want to be certain nothing is consumed. Sort keys A to Z walks the entire object tree and emits every key in lexicographic order, making two logically identical documents byte-equal so a diff tool or a hash comparison treats them as the same file. Escape non-ASCII replaces every character above U+007F with its \uXXXX sequence, useful when the output will travel through a system that is not encoding-aware.
The stats bar shows original bytes, minified bytes, bytes saved and reduction percentage. Everything runs in the browser tab with no upload, no server, and no account.
The lead sample is a checkout-api service descriptor with four top-level keys, a nested env object and a two-item features array. Click Load Sample and the input fills with 260 bytes of pretty-printed JSON. The output panel immediately shows the single-line result at 204 bytes: 56 bytes saved, 21.5% reduction. Turn on Sort keys A to Z and the output re-orders to env, features, owner, replicas, service, version. That is useful when you need two versions of the same config to compare cleanly by hash rather than by eye. Click Load Sample a second time to advance to the shipment document, which minifies its nested legs array of objects in the same pass.
JSON.parse treats // as a syntax error. The toggle is on by default precisely to prevent this, but if you turn it off for a comment-free document and see that message, a comment crept in.Number.MAX_SAFE_INTEGER) parse correctly but are serialised back to the nearest float, which may not be the value you started with. BigInt JSON is not part of the spec, so this is a limitation of the format rather than the tool."id" fields) will have the first value silently overwritten by the second, as per the ECMA-262 spec for JSON.parse. The output will be valid but may be smaller than expected.Options
{"service":"checkout-api","version":"2.4.0","replicas":3,"env":{"LOG_LEVEL":"info","TIMEOUT_MS":3000},"features":["apple-pay","gift-cards"],"owner":{"team":"payments","oncall":"ana.ruiz@harbourline.dev"}}