Output will appear here
Output will appear here
Paste JSON and this minifier returns it on a single line with all whitespace between tokens removed. Spaces inside string values are kept, so the data is unchanged. It works by parsing and re-serializing with JSON.stringify, which also normalizes some spellings: 3.50 becomes 3.5 and \u00e9 becomes é. Invalid JSON is rejected with the parser error, not half-minified.
By Ankit Aglawe · Updated · Runs entirely in your browser
Indentation and line breaks are gone. The spaces inside "*/15 * * * *" stay, because they are part of a string value, not formatting.
{
"app": "inventory-sync",
"schedule": "*/15 * * * *",
"sources": [
{ "type": "postgres", "table": "stock_levels" },
{ "type": "s3", "bucket": "supplier-feeds", "prefix": "daily/" }
],
"dryRun": false
}{"app":"inventory-sync","schedule":"*/15 * * * *","sources":[{"type":"postgres","table":"stock_levels"},{"type":"s3","bucket":"supplier-feeds","prefix":"daily/"}],"dryRun":false}The 87-character input comes out at 66 bytes. \u00e9 (6 characters) becomes é (2 bytes in UTF-8), and 3.50 becomes 3.5. The parsed values are identical.
{
"title": "Caf\u00e9 menu",
"items": [ { "name": "Flat white", "price": 3.50 } ]
}{"title":"Café menu","items":[{"name":"Flat white","price":3.5}]}Only whitespace between tokens is removed. "a b" keeps both spaces, and escaped \n stays as \n. Nothing inside quotes is touched.
Trailing zeros go (3.50 to 3.5, 1.0 to 1), exponents are expanded (1e3 to 1000) and integers above 2^53 are rounded, because every number passes through a JavaScript double. Send exact 64-bit ids as strings.
If a key appears twice in one object, only the last value is written. A minified file can therefore be shorter for a reason other than whitespace.
\uXXXX escapes are written out as the actual character, which is usually smaller in bytes. Lone surrogates such as \ud800 stay escaped. If the receiver needs pure ASCII, this is the wrong tool.
Minifiers for JavaScript strip comments; this one does not accept them at all, since it parses strict JSON first. Remove comments or trailing commas, or the output pane shows the parse error.
It depends on indentation and nesting. The GitHub issue from the formatter page is 348 characters at 2-space indent and 416 at 4 spaces; minified it is 245, so 30% and 41% smaller. Over HTTP, gzip or brotli save far more, and minifying first adds little on top.
Enter any valid JSON with whitespace, indentation, or newlines in the editor. The minifier works with objects, arrays, and primitive values.
The tool removes all unnecessary whitespace, newlines, and indentation, producing the most compact valid JSON possible.
Click Copy to grab the minified output for embedding in API calls, config files, or storage systems where size matters.
Paste it into the left pane. The single-line version appears on the right. Copy it or download it.
No. Parsing the output gives the same values as parsing the input. The text can differ beyond whitespace: number spelling, decoded escapes, and a duplicated key keeps only its last value.
Yes. Whitespace between tokens is optional in JSON, and the output is produced by JSON.stringify, so any JSON parser reads it.
For HTTP responses, compression matters more. For JSON embedded in a URL, an HTML attribute, an environment variable or a log line, minifying is what makes it fit on one line.
Use jq -c . file.json, or python3 -c "import json,sys; print(json.dumps(json.load(sys.stdin), separators=(',', ':')))" < file.json.
Use the JSON Formatter, or switch the toggle above the output from Minify to Beautify.
Need several formats at once? Convert All shows every output from one paste. Or browse all JSON converters.