What it does
Minifying removes all whitespace that is not part of a string, so the same data takes fewer bytes to store and send. It changes only whitespace: numbers such as 1.10 or 12345678901234567890, string escapes and the order of keys are kept exactly as written.
When to use it
- Shrinking JSON for API payloads, config embedded in HTML, or local storage.
- Putting a JSON document on one line for logs or command-line arguments.
Good to know
The input is validated first, and errors are reported with a line and column. Duplicate keys are reported as a warning because most parsers silently keep only the last value. To make JSON readable again, use the JSON Formatter.
Example
{
"id": 7,
"price": 1.10,
"tags": ["a", "b"]
}
{"id":7,"price":1.10,"tags":["a","b"]}The second line is the output: 38 bytes instead of 52, with 1.10 unchanged.
Limits and common mistakes
- Only strict JSON is accepted. Comments, trailing commas, single-quoted strings and unquoted keys are reported as errors, with the line and column, instead of being silently dropped. Fix those first, or check the document with the JSON Validator.
- A leading byte order mark is ignored. Whitespace inside strings, including tabs written as
\t, is part of the data and is kept. - An already-compact document shows 0% smaller. That is expected, not a failure.
- Minifying is not compression: it does not shorten key names, sort keys or remove duplicates. If the transfer size matters, servers also apply gzip or Brotli on top of it.
- To turn the minified JSON into CSV or typed code, continue with the JSON to CSV converter or JSON to Code. For files with one JSON value per line, use the NDJSON tool.
When not to minify
Keep the readable version for files that people edit or compare, such as configuration in version control, because a one-line file produces unreadable diffs. Minify the copy that you send over a network, embed in a page or store in a size-limited place. You can always turn it back with the JSON Formatter.
Frequently asked questions
Does minifying change my data?
No. Only whitespace outside strings is removed. Values, number formatting such as 1.10, string escapes and key order stay exactly as written.
How much smaller will my JSON get?
It depends on how much indentation the original has. A document that is already compact shows 0% smaller, which is expected. The tool shows the byte counts before and after.
Is minifying the same as compressing?
No. Minifying removes whitespace; gzip or Brotli compression, which servers apply on top, shrinks the file much further.
Is my JSON uploaded?
No. The minifier runs in your browser.
Privacy
This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.