MSRX Tools

JSON Minifier

Strip every space and newline out of a JSON payload.

Everything runs inside your browser. Your files never leave your device.

Input

Result

The result appears here as you type.

Ask about JSON Minifier

Questions about what this tool does, which option to pick, or what it can and cannot handle.

This is the one part of the site that uses a server. The question you type here is sent to an AI provider to be answered — your files and whatever you put in the tool above are not, and the assistant cannot see them. Answers are generated and can be wrong; the tool itself is not guessing.

About the JSON Minifier

Minifying JSON removes every space, newline and indent that a parser does not need. The result is identical data in fewer bytes — typically thirty to fifty per cent smaller for a document that had been pretty-printed, and more than that for deeply nested structures where indentation dominates.

It is worth doing whenever the JSON is going over a wire or into a store that charges by size: an API request body, a config blob in a database column, a payload embedded in a URL or a data attribute, a message on a queue. It is not worth doing to a file a person has to read, and it is pointless before gzip, which will squeeze the whitespace out anyway.

The tool reparses the document rather than stripping whitespace with a regular expression. That distinction matters: a naive strip would happily destroy the spaces inside your string values. Because this one parses and re-serialises, a string containing newlines or indentation survives exactly as written, and anything that would not parse is reported instead of being silently mangled.

The size figures above the result show the before, the after and the percentage saved, so you can see whether the exercise was worth it for your particular document.

How to use it

  1. 1Paste the JSON you want to shrink into the input box.
  2. 2The minified version appears immediately below — there is nothing to configure.
  3. 3Check the before and after sizes in the figures above the result.
  4. 4Copy the result, or download it as a .json file.

Questions

Does minifying change my data?
No. The document is parsed into values and written back out with no formatting. Every key, value, number and string is preserved exactly, including whitespace that appears inside string values.
How much smaller will my JSON get?
It depends entirely on how it was formatted. A document indented with four spaces and heavily nested can lose more than half its bytes; one that was already on a single line loses nothing.
Should I minify before gzip?
There is little point. Gzip compresses repeated whitespace extremely well, so the compressed sizes end up within a few per cent of each other. Minify when the bytes are stored or measured uncompressed.
Will it remove my comments?
Strict JSON has no comments, so a document containing them will not parse at all. The tool reports the position of the comment rather than quietly deleting it.