JSON Minifier — Compact JSON Online
Strip whitespace from pretty JSON to shrink payloads — entirely client-side.
What it does
Pretty-printed JSON is easy for humans to read, but every space and newline is wasted bytes going over the wire. Minifying strips all non-essential whitespace so the structure and values stay identical, just smaller.
Typical shrinkage is 20–40%, depending on how deeply nested your data is. For REST APIs, websocket frames or embedded JSON-in-URL (like convert2's own share links), every kilobyte counts.
How to use it
- Paste your pretty JSON into the left pane.
- The minified single-line version appears on the right, silently.
- Copy it, download as
.json, or pipe it into the next step of your build. - If the JSON is invalid, the output shows the parser error with its line and column.
Example
{
"name": "convert2",
"version": "1.0.0",
"active": true,
"tags": ["tool", "formatter"]
}
{"name":"convert2","version":"1.0.0","active":true,"tags":["tool","formatter"]}
Why convert2
- Smaller payloads. 20–40% savings typical, more for deeply nested data.
- URL-safe. Minified JSON embeds cleanly in query strings and fragments.
- Round-trip safe.
JSON.parse(minify(input))equalsJSON.parse(input)for all valid input. - Private. Same promise as every other convert2 tool — your data doesn't leave the tab.
Common use cases
- Shrinking response bodies before gzip, when you control the server.
- Packing JSON into a URL fragment for share links or deep-linking.
- Preparing fixtures for tests where line-level diffs matter.
- Shipping JSON inside HTML
data-*attributes.
JSON Minifier specifics
- Uses the browser's native
JSON.stringify(obj)— no custom tokenizer. - Key order is preserved from input.
- String contents are untouched — spaces inside string values stay.
- For lossy minification (removing null keys, defaults, etc.) you need a schema — convert2 does not do that.
Frequently asked questions
What does minifying JSON do?
It removes all non-essential whitespace — spaces, newlines, tabs — to produce the smallest valid JSON representation. The structure and values stay identical.
Is the JSON still valid after minifying?
Yes. Minification only strips whitespace; every parser that accepts the pretty version accepts the minified version.
Do strings with spaces inside still work?
Yes. Whitespace inside string values is preserved — only structural whitespace between tokens is removed.