What is a JSON minifier?
A JSON minifier compacts JSON to a single line by stripping every space, tab, and newline that a parser ignores. The result is the smallest text that parses to exactly the same value. It is the inverse of a beautifier: minify for transport and storage, beautify for reading. This tool minifies in your browser with zero uploads, and auto-repairs messy input so even hand-edited or LLM-generated JSON compacts cleanly.
Minify vs. gzip
Minifying and gzip are complementary. Minifying removes whitespace at the JSON level; gzip then compresses the remaining bytes at the transport level. Servers usually gzip responses automatically, but minifying first still helps: it shrinks what gets stored, embedded, or logged, and reduces the input gzip has to work on. For the absolute smallest wire size, minify and enable gzip/brotli.
How to use
- Paste JSON into the Input pane.
- The minified, single-line output appears instantly in the Output pane.
- Non-standard input (single quotes, trailing commas, comments) is auto-repaired first, so messy JSON minifies too.
- Copy or download the result. Your input is never modified.
- Everything runs in your browser; check DevTools → Network for zero requests.
Examples
Pretty JSON → minified
{
"id": 42,
"name": "workbench",
"tags": ["json", "diff"]
}{"id":42,"name":"workbench","tags":["json","diff"]}Whitespace and newlines removed
{
"a": 1,
"b": [ 1, 2, 3 ]
}{"a":1,"b":[1,2,3]}Messy input is repaired, then minified
{ 'a': 1, 'b': 2, }{"a":1,"b":2}FAQ
What does minifying JSON do?
It removes all insignificant whitespace (spaces, tabs, and newlines between tokens), producing the smallest valid JSON that still parses identically. Keys, values, and order are unchanged.
Why minify JSON?
Smaller payloads transfer faster and cost less bandwidth. Minified JSON is ideal for API responses, config embedded in HTML/JS, message queues, and anywhere size matters. Gzip shrinks it further.
Does minifying change my data?
No. Only formatting whitespace is removed. The parsed value is byte-for-byte equivalent; JSON.parse of the minified output equals the original.
Is my JSON uploaded?
No. Minification runs 100% in your browser. Open DevTools → Network and confirm zero requests after the page loads.
Can it minify invalid JSON?
Common non-standard input (single quotes, trailing commas, comments, Python-style True/False/None) is auto-repaired first. Genuinely broken JSON shows the exact line and column of the error instead.