DevToolBayFree Developer Tools

JSON Minifier

Minify JSON to a single line by stripping all insignificant whitespace. See original vs minified size and exactly how many bytes you saved. Fully offline.

How it works

The input is parsed then re-serialized with JSON.stringify, which guarantees the result is still valid JSON — blind regex stripping can corrupt string contents. Minification removes line breaks, indentation and spaces around separators. Keep a formatted copy of config files somewhere safe; minified output is meant for transfer and storage.

How to use JSON Minifier

Paste pretty-printed JSON and the minified single-line output appears with exact before-and-after sizes. The document is validated first, so malformed input is rejected with a precise position instead of producing a plausible-looking corrupt file.

Whitespace outside strings is the only thing removed — key names, string contents and numbers survive byte-for-byte. Typical pretty-printed payloads shrink 30 to 60 percent. Keep a formatted source in version control and minify at build or deploy time; this tool handles the deploy-time half.

Frequently asked questions

What does JSON minification remove?

Only whitespace outside strings — indentation, line breaks and spaces around punctuation. Strings, numbers and key names stay byte-for-byte identical afterwards.

How much smaller does JSON get?

Pretty-printed files often compress 30 to 60 percent depending on nesting depth. The tool reports exact before and after sizes for every run.

Is the minified JSON valid?

Yes. Minifying runs through the same parser as the validator first, so invalid input is rejected with a precise position instead of producing a corrupt file.

Should I minify config files I still edit?

Prefer minifying only transport or storage copies. Keep a pretty-printed source in version control and minify at build or deploy time.

Related tools