JSON Minifier
Minify JSON safely by re-serialising it, not by stripping whitespace with a regex. Shows the byte saving and warns about lost precision.
Minified by re-serialising the document, so invalid JSON fails here rather than downstream.
Related tools
All Developer tools →This tool runs entirely in your browser. Nothing you enter is sent to our servers, so there is nothing for us to store or see.
About the JSON Minifier
Strip every unnecessary space, tab and newline from a JSON document and see exactly how many bytes that saved. Useful before embedding configuration in a build artefact, storing a payload in a database column, or shaving a few kilobytes off an API response.
The minifying is done by parsing the document and writing it back out, not by running a regular expression over the text. That distinction matters more than it sounds: a regex cannot tell a space between two tokens from a space inside "full name", so it quietly corrupts any real document while still producing something that looks like JSON. Parsing first means invalid input fails loudly, with the line and column of the problem.
Two things can genuinely change during a round trip and the tool checks for both. Numbers longer than about sixteen digits exceed what JavaScript can hold exactly, so a large ID silently loses its last digits — you get warned, with the before and after. And where the same key appears twice in one object, JSON keeps only the last value, so the document gets smaller because data was thrown away. That is worth knowing about rather than discovering later.
How to use the JSON Minifier
-
Paste your JSON
Into the left box, or drop a .json file onto it. Minifying starts as soon as you stop typing.
-
Check the saving
The line under the boxes reports the original size, the minified size and the percentage saved, all measured in bytes rather than characters.
-
Read any warnings
A warning about lost precision or removed duplicate keys means the output is not byte-for-byte the same data. Fix those before shipping the result.
-
Copy or download
Copy the minified JSON to your clipboard, or download it as a .json file ready to commit.
Frequently asked questions
How much does minifying JSON actually save?
On an indented document, typically 15 to 30 per cent of the raw bytes. Over a network with gzip or brotli enabled the real saving is far smaller, because indentation is highly repetitive and compresses almost to nothing. Minify for storage and embedding; do not expect much from it on a compressed HTTP response.
Why not just remove the whitespace with find and replace?
Because a text-level replacement cannot tell whitespace between tokens from whitespace inside a string value. Any document containing a key like "full name" or a sentence in a description field gets silently corrupted, and the result still parses, so the damage is not obvious until something downstream breaks.
What is the warning about numbers losing precision?
JSON allows numbers of any length, but JavaScript stores them as 64-bit floats with about 15 to 16 significant digits. An ID such as 9007199254740993 comes back as 9007199254740992 — quietly wrong. The fix is to quote large identifiers as strings so they are never treated as numbers at all.
What happens to duplicate keys?
JSON parsers keep the last value and discard the earlier ones, so the minified output is genuinely missing data rather than merely being smaller. The tool counts the keys before and after and tells you when this has happened, because a silently shrinking document is exactly the kind of thing you want to know about.
Is my JSON uploaded anywhere?
No. Parsing and minifying both happen in your browser and nothing is transmitted or stored, which is what makes this safe for API responses containing customer data, credentials or anything else confidential.