Paste your JSON
From a file, an API response, a configuration or an editor.
Paste your JSON and get the smallest valid version: no spaces, no line breaks, no indentation. It is checked as it is minified, and the size you save is shown.
100% private — your text is processed in your browser and never sent to any server.
Keep going with your result in another tool. Nothing is uploaded.
From a file, an API response, a configuration or an editor.
It is validated as it is minified. Errors are shown with their exact line and column.
Use it in a request, a script tag, a configuration value or a file.
Pretty-printed JSON is written for people, with a new line and an indentation for every item. Programs do not need any of that. Minifying removes every space, tab and line break that is not part of a value, which makes the text shorter without changing a single piece of data. For large documents the saving can be worthwhile: smaller payloads travel faster, fit into fields with a length limit and take less space in a URL, a cookie, a configuration variable or a database column.
Only the whitespace between the elements is removed. Strings keep every space inside them, the order of the keys is kept as it is (unless you choose to sort them), and numbers are written exactly as you wrote them, so a long identifier such as 12345678901234567890 comes out unchanged instead of being rounded, as happens when JSON is converted through a program that reads numbers as floating-point values. Nothing about the meaning of the document changes; you can format it again at any time with the JSON formatter.
The document is read according to the JSON standard before it is compressed, so a missing bracket, a trailing comma or a value in single quotes is reported with the line and column where it goes wrong, instead of producing a broken output. If the input comes from a chat, a configuration with comments or an object copied from code, switch on "Repair common mistakes first": single quotes, trailing commas, comments, unquoted keys and similar are fixed before minifying.
Below the result you see the size before and after and the percentage saved. Indented JSON with short values often shrinks by a third or more; a document that was already compact will show little or no saving.
Minifying is not compression in the sense of gzip: it does not reduce the size to what a compressed transfer would give, though servers usually compress and minified JSON compresses well too. It does not shorten keys, remove unused fields or change any value. Use it as one step, alongside compression, to make a document lighter.
More utilities that also run without leaving your browser.