JSON Minify
Compress JSON by removing whitespace and line breaks for smaller payloads and faster transfers.
- Free
- No signup
- Private
Users Also Use
How to Use
- Paste JSON in the input box.
- Click Minify JSON to remove all unnecessary whitespace.
- Copy the single-line result.
What does JSON minify do?
JSON minification removes every space, tab and line break that sits outside string values, so the whole document becomes one compact line. The data stays exactly the same; only the formatting is removed. Minified JSON is smaller to send over a network, faster to store, and is the usual format for API responses, configuration bundled into an app, and data embedded in HTML.
Worked example
This formatted input of 35 characters becomes 25 characters after minifying, about 29 percent smaller:
{
"id": 7,
"tags": ["a", "b"]
}
Minified:
{"id":7,"tags":["a","b"]}
How much space will I save?
It depends on how much indentation the input has. Deeply nested JSON formatted with two or four spaces often shrinks by 20 to 40 percent. If your server already compresses responses with gzip or Brotli, the gain on the wire is smaller, because compression already handles repeated spaces well. Minifying still helps for stored files, localStorage and anything that is not compressed.
Behaviour to be aware of
- Spaces inside string values are kept, because they are part of the data.
- If the input has a trailing comma or a missing closing bracket, the tool repairs it before minifying.
- Numbers are written in their shortest form, so 2.0 becomes 2.
- Integers larger than 9,007,199,254,740,991 lose precision in JavaScript; store them as strings.
- Duplicate keys keep only the last value.
Privacy
Minification runs in your browser. The JSON you paste is not uploaded to our server.
FAQ
- Is minified JSON still valid JSON?
- Yes. Whitespace between tokens is optional in JSON, so the minified output parses to exactly the same data.
- Can I undo minification?
- Yes. Paste the minified JSON into the JSON Formatter to add indentation and line breaks back.
- Does minifying remove comments?
- JSON does not allow comments, so input with comments is not valid JSON and will not be kept in the output.
- Is minifying the same as compressing?
- No. Minifying removes unneeded whitespace but keeps plain text. Compression such as gzip encodes the data into a smaller binary form that must be decompressed before use.