JSON Minifier
Free JSON minifier: remove spaces and line breaks to make JSON smaller, validate it on the way and see the bytes saved. Runs in your browser, nothing is uploaded.
How to use JSON Minifier
- 1Paste or open the JSON you want to compress.
- 2The minified version appears immediately, with the size before and after. Mode switches to Format, Sort keys, Tree or Escape.
- 3Copy it, or download minified.json for your build or request.
What makes it better
- Removes all insignificant whitespace and nothing else
- Shows bytes saved and the percentage
- Validates the JSON and reports the line and column of any error
- Long numbers and escapes are kept exactly as written
- Mode switch to Format, Sort keys, Tree or Escape, plus optional removal of nulls and empty values
About JSON Minifier
JSON Minifier removes every space, tab and line break that is not part of a string, leaving the most compact valid JSON. The result is checked as it is produced, so a syntax error is reported with its line and column instead of producing broken output. Values are copied verbatim, including very long numbers, and the footer shows the size before and after.
Common uses
- Shrink a JSON fixture before embedding it in a script or a test.
- Put a payload on one line to paste into a curl command or a query parameter.
- Reduce the size of a config file that is shipped to browsers.
- Prepare a single-line record for a log file or a message queue.
Example
Input
{
"id": 12345678901234567890,
"name": "Ada",
"tags": [ "a", "b" ],
"active": true
}Result
{"id":12345678901234567890,"name":"Ada","tags":["a","b"],"active":true}Good to know
- Minifying only removes whitespace. It does not shorten keys or remove fields, so savings depend on how much indentation the original had.
- For transfer over HTTP, gzip or Brotli usually shrinks JSON far more than minifying does, and the two work together.
- Invalid JSON is rejected rather than repaired, so fix reported errors first.
JSON Minifier FAQ
What does a JSON minifier do?
It deletes the spaces, tabs and line breaks between tokens, so the same data takes fewer bytes. Anything inside a quoted string is left alone, which keeps the meaning of your data unchanged.
How much smaller will my JSON get?
It depends on how it was indented. Deeply nested, 4-space formatted files often shrink by 30 to 50 percent, while JSON that is already compact stays about the same. The footer shows the exact saving for your input.
Is minified JSON still valid?
Yes. Whitespace between tokens carries no meaning in JSON, so any parser reads the minified text exactly like the original. You can pass it through the formatter later to make it readable again.
Can I minify JSON that has comments?
Not directly, because comments are not part of the JSON standard and are reported as errors. Delete the comments first, then minify the clean JSON.
Will minifying change my big numbers or unicode text?
No. Number literals and string escapes such as \u00e9 are copied character for character, so IDs larger than 2^53 and special characters come out identical to what you pasted.