ALL DEVELOPER TOOLS56
JSON Minify
Minify JSON Online — Free & Instant
Drop a .json file or paste the text, and get it back with every byte of insignificant whitespace gone.
About JSON Minify
Minifying JSON is meant to be the safe half of formatting: nothing about the data changes, only the spaces between the tokens. Most minifiers do not manage that, because they run JSON.parse and then JSON.stringify, and that round trip is a pass through IEEE-754 doubles. A Snowflake or database id like 12345678901234567890 comes back as 12345678901234567000, a rate written 1.0 comes back as 1, 1e2 comes back as 100, and two keys with the same name silently become one. From a button labelled Minify, that is data corruption wearing a success message. This page uses the scanner the JSON formatter already ships: it walks the raw characters, copies every string, number and keyword through untouched, and emits the structural punctuation and none of the whitespace. Parsing happens separately, purely to decide whether the input is valid, and the browser's own error is what you are shown. The result is a byte count you can trust: source size, minified size, percentage saved, and how many of the removed bytes were whitespace rather than a byte-order mark. What it will not do is rename keys, reorder anything, drop empty fields, or strip a mark you did not ask about.
Questions
Will this round my long numeric ids?
No, and that is the whole reason this page exists. The usual way to minify JSON is JSON.parse followed by JSON.stringify, which is a round trip through a 64-bit float: an id like 12345678901234567890 comes back as 12345678901234567000, 1.0 comes back as 1, and 1e2 comes back as 100. This tool never re-serialises. It scans the characters you gave it and rewrites only the whitespace between them, so every string, number and keyword is copied through exactly as you typed it. Parsing happens separately, and only to decide whether the input is valid.
My file is valid JSON but this says it is not.
Four things cause that. A UTF-8 byte-order mark at the start, which RFC 8259 does not permit and the browser's parser rejects before it reads a key — there is a box in the rail to drop it, and a warning on screen when one is found. Trailing commas, comments and unquoted keys, which are JSON5 or JSONC rather than JSON, and which no browser parser accepts. Single-quoted strings, same story. And NaN or Infinity, which JavaScript will print but JSON cannot hold. The error line shows the parser's own message, plus the line and column when the engine reports one.
Can it handle NDJSON or a .jsonl file?
No. In NDJSON every line is a separate JSON document with no commas and no enclosing array, so the file as a whole does not parse and this page will report an error at the start of the second line. That is honest rather than helpful: minifying each line independently would be a different tool with different semantics, and quietly wrapping your lines in an array would change the shape of your data. For now, split the file and run the documents one at a time, or use the JSON formatter's validate pass on a single record.
How much smaller should I expect the file to get?
It depends entirely on how it was indented, and the page prints the real figure rather than a promise. Two-space-indented JSON from an API browser or a pretty-printer typically loses 20 to 40 percent, because most of the whitespace is leading indentation that grows with nesting depth. JSON that was already written compactly, or that is mostly long string values, may lose almost nothing. The stat strip shows the source size, the minified size, the percentage and the line count, and the rail reports how many of the removed bytes were whitespace as opposed to a byte-order mark.
Does it shorten keys or drop empty fields?
No to both, and no to reordering. Those are transformations of your data, not of its formatting, and a button labelled Minify has no business making them. Duplicate keys survive too: JSON.parse would collapse two keys of the same name into the last one, and because this tool rewrites the raw text rather than re-serialising a parsed value, both are still in the output. Null values, empty strings, empty objects and empty arrays are all kept. The only thing that leaves is whitespace between tokens, plus the byte-order mark if you tick that box.
Is my file uploaded to a server?
No. Transmute processes everything locally in your browser using JavaScript and WebAssembly. Your files never leave your device — there is no server, no upload, no cloud processing.