JSON minifier
What the JSON minifier does
Paste any valid JSON, however it is currently formatted, spread across many lines, inconsistently indented, already partly compact, and this tool parses it and returns the smallest valid representation of the exact same data: no line breaks, no indentation, no spaces between tokens that do not need them.
It runs in your browser. Nothing you paste is uploaded, there is no signup, and there is no limit on how much JSON you minify.
The underlying fact
Why whitespace in JSON doesn't matter, in plain terms
JSON's grammar treats the spaces, tabs and line breaks between its structural characters, braces, brackets, colons, commas, as entirely optional. '{"a":1}' and a version of the same object spread across five indented lines describe exactly the same data to anything that parses it. The formatting exists purely for the person reading the file, never for the machine consuming it.
That is exactly what minifying takes advantage of: since none of that whitespace changes the meaning, removing every byte of it produces a file that is functionally identical to the original but smaller.
How it works
How to minify JSON in three steps
Nothing to configure, nothing to install.
- Step 1
- Paste your JSON into the input box, in whatever format it currently has.
- Step 2
- Press Minify. The tool parses and re-serialises it instantly, on your own device.
- Step 3
- Copy the compact result from the output box.
Why it matters
What minifying JSON actually saves you
The saving is pure byte count, nothing about the data's structure or meaning changes. For a payload embedded in a URL query parameter, a value stuffed into an environment variable, a script tag's inline data, or a '.min.json' asset shipped to every visitor of a website, every removed byte is one less byte to transmit and parse.
For a small, one-off object the difference is trivial. For a large configuration file, a sizeable API response used as a fixture, or an asset served to thousands of page loads, the removed whitespace adds up to a real, if modest, reduction in transfer size.
A side effect worth knowing
Why minifying also validates your JSON, and why that matters
To minify a value at all, this tool first has to parse it, which means anything that is not syntactically valid JSON, a trailing comma, an unquoted key, a comment, gets rejected outright with an error rather than silently mangled. That makes this tool a quick validity check as a side effect, even when saving bytes was not the point of pasting something in.
A common reason for that rejection is pasting JSON5 or JSONC, formats that allow comments and trailing commas and look almost identical to plain JSON. Standard JSON supports neither, so text copied from a config file written in one of those relaxed formats will fail here until the comments and trailing commas are removed.
Straight answer
Does valid JSON mean correct data?
No, and it is worth being direct about that. This tool confirms that what you pasted follows JSON's syntax rules, correctly matched braces and brackets, properly quoted keys, no trailing commas. It has no idea whether the values inside are the right values, whether a required field is missing, or whether a number should have been a string.
Syntactic validity and correctness are two different things. Minifying, or its counterpart, pretty-printing, only ever addresses the first one.
Who uses it
Who uses a JSON minifier, and when
Developers use it to shrink a config value that has to fit into a single environment variable, a URL parameter or a command-line argument. Front-end engineers use it to compact a small JSON asset before it ships to every page load, when a build tool's own minification step is not available.
Anyone preparing a JSON payload for a single-line log entry, a database column that does not handle line breaks well, or a chat message with a length limit uses it to compress the JSON down to one clean line without touching any of the actual data inside it.