JSON Minify
This JSON minifier strips redundant whitespace, indentation and line breaks to produce compact single-line output. Formatted JSON typically shrinks by 15%–40%, which helps with API payloads, production configs and single-line environment variables. Minifying only changes whitespace, so keys, values, types and order are preserved and the result can be restored at any time. Parsing and serialisation run in a Web Worker inside your browser, so nothing is uploaded and files up to 10 MB are handled comfortably.
How to use it
- 1
Paste or open your JSON
Paste formatted JSON into the input, or use the button / drag-and-drop to open a local file. The input is validated first, so syntax errors are reported before minifying.
- 2
Optionally enable key sorting
Turn on "Sort keys" when you want stable, byte-identical output that is easier to compare against earlier versions. The order of array elements never changes.
- 3
Click Minify
The Worker instantly returns single-line minified JSON: no indentation, no line breaks, only the quotes and colons JSON syntax requires.
- 4
Copy or download
Copy the result or download it as a .json file. When you need to read it again, run it back through the formatter to restore the layout.
Key features
Whitespace removed, data untouched
Minifying is equivalent to parsing and re-serialising: no fields are dropped, types and values are unchanged, and the result is reversible.
15%–40% smaller payloads
The deeper the indentation and the longer the arrays, the more whitespace there is to remove. Single-line output saves space in logs, message queues, caches and URLs.
Combine with key sorting
The same data minified to identical bytes every time, so version control and snapshot comparisons are not disturbed by line breaks or key order.
Non-ASCII stays readable
Non-ASCII characters are emitted directly rather than as \uXXXX escapes, so the output stays human-readable.
Large files and big-integer hints
10 MB files are minified in a Worker; integers beyond 2^53-1 trigger a hint to enable big-integer mode so ID-like fields keep full precision.
Nothing to install
Works straight in the browser — no sign-up and no pop-up ads.
Common errors & troubleshooting
- ! The result is one very long line meant for machines, not for reading. When you need to debug, restore the layout with the formatter.
- ! If your pipeline already uses gzip or brotli, the space savings are smaller (the compressor also collapses whitespace), but minifying is still a zero-cost first optimisation.
- ! Minifying cannot fix invalid JSON: trailing commas and single quotes are reported by the validator first — fix them using the line and column hints, then minify.
- ! When you send an HTTP request, remember to include Content-Type: application/json. Minifying reduces size but does not replace the protocol header.
Frequently asked questions
Does minifying change my data, numbers or non-ASCII text?
No. Minifying only removes indentation, spaces and line breaks; fields, values, booleans, null and array order are all preserved, and non-ASCII text is written as-is rather than escaped. One edge case: integers beyond 2^53-1 can lose their last digits in a normal parse, so the tool detects them and suggests big-integer mode for lossless minifying.
How is JSON minifying different from gzip?
Minified output is still valid JSON that any parser reads without decompression; gzip is a binary transport-level compression that the client must decode. They work well together: minify first, then let Nginx or a CDN apply gzip. Minifying also reduces storage size in databases and caches.
Why did my JSON become a single line?
That is the point of minifying: line breaks and indentation are only for humans and are not part of the data, so the single-line form is the smallest. When you need to read or review it, run it through the formatter to restore the hierarchy.
Is my data uploaded when minifying?
No. Parsing and serialisation happen locally in your browser and nothing is sent to a server.
Related tools
JSON Formatter
Format, beautify and validate JSON in your browser. Errors point to the exact line and column, and you can indent with 2 spaces, 4 spaces or a tab.
JSON Key Sorter
Recursively sort object keys in alphabetical order when you format or minify JSON. Arrays keep their order. Get deterministic output for diffs, snapshots and config baselines.
JSON Validator
Check whether your JSON is valid. Syntax errors are highlighted with the exact line and column, plus a hint about the token that was expected.
JSON to CSV
Convert an array of objects into CSV you can open in Excel or WPS. Columns are the union of all keys, nested objects flatten to dot-separated names, and comma, semicolon, pipe or tab delimiters are supported.