Strip all insignificant whitespace from JSON and see exactly how many bytes you saved -- keeps big numbers and key order exactly as typed, entirely in your browser. Fast, free, and built for simple browser-based workflows.
Minifying happens entirely in this browser tab. The JSON you paste, drop or open here — an API response, a config file, an export with customer data — is never sent anywhere.
728 x 90 In-Content Ad
JSON Minifier is a free online tool that strips every unnecessary space, tab, and line break from JSON to shrink it to the smallest valid size. Paste JSON, open a .json file, or drop one onto the page, and it prints a single compact line and tells you exactly how many bytes you saved.
It earns its keep whenever JSON needs to travel somewhere size matters: a config value you're about to embed in an environment variable, a sample payload going into documentation or a test fixture, or an API response you want to paste into a chat thread without a wall of indentation taking over the screen. Stripping whitespace by hand risks breaking a string by accident, since a stray edit inside a quoted value corrupts the data -- the same mistake a naive whitespace stripper can make without you noticing.
Minifying happens entirely in this browser tab, so the JSON you paste, drop or open here -- an API response, a config file, an export with customer data -- is never sent anywhere. That matters when you're shrinking a payload that still has live keys or personal fields in it, and it means there's no upload step to wait through first.
Paste JSON into the box, click Open file to choose a .json file, or drag one onto the box. Click "Try an example" to see a sample with a large id.
Tick "Accept comments and trailing commas (JSONC)" if your file has // or /* */ comments or a trailing comma, like tsconfig.json. Leave it off for standard JSON.
Press Minify JSON, or Ctrl+Enter from anywhere on the page. Valid JSON collapses to a single compact line with the bytes saved shown above it; invalid JSON shows the exact line, column and a Go to error link.
Use Copy for the clipboard or Download to save it as minified.json. Clear resets the input, output and any error state.
Yes! All our tools are 100% free to use with no hidden costs, no registration required, and no credit card needed.
Absolutely. All tools run entirely in your browser (client-side). Your data never leaves your device and is not sent to our servers.
Yes, once the page is loaded, the tool will continue to work even if you lose internet connection since it runs in your browser.
There is no strict character limit, but very large amounts of text (100,000+ characters) may slow down your browser.
Yes! All our tools are free for both personal and commercial use.
JSON Formatter adds indentation to make JSON easy to read; this tool does the opposite -- it strips every insignificant space to make the file as small as possible and reports exactly how many bytes that saved. Use Formatter when you want readable output, and this page when you want the smallest valid file to ship or store.
It scans your JSON the same way a validator does, so invalid JSON is rejected with the exact line and column instead of silently producing broken output -- but it does not warn about valid-but-risky JSON like duplicate keys, oversized numbers or deep nesting, or report document stats. Use JSON Validator when you need that full report.
Because that can corrupt your data. A plain find-and-replace or regex has no idea whether a space sits inside a string or between tokens, so it can delete a space you typed on purpose inside a value like "two words", or mangle an escape sequence. This tool parses the JSON properly first, so only whitespace between tokens is ever removed.
No. Numbers are copied exactly as typed, including very large integers, trailing zeros like 1.0, and scientific notation like 1e400. Most tools parse JSON into JavaScript numbers first, which silently rounds any integer above about 9 quadrillion -- this one never does that.
Both are kept, in the order they appeared. JSON technically allows duplicate keys even though most parsers only keep the last one, and minifying never silently drops data because of it -- the result message tells you how many duplicates it found.
Only if you turn on the JSONC option. Standard JSON does not allow // or /* */ comments or trailing commas, so by default they are treated as errors. Turning on JSONC accepts both and removes them from the output along with the rest of the whitespace, which is useful for files like tsconfig.json.
By measuring the actual UTF-8 byte size of your input and the minified output with TextEncoder, then subtracting -- never by counting characters. That matters outside plain ASCII: an emoji is 4 bytes and an accented letter is usually 2, even though each counts as only one or two JavaScript characters.
Because your JSON already had no extra whitespace, comments or trailing commas to remove, so the minified output is identical to what you pasted. That is the expected result for JSON that was already minified somewhere else, not an error.
Yes. Most files up to a few megabytes minify instantly. Above about 10MB you will see a brief "this may take a few seconds" notice before it runs, and the result is limited only by your own device's memory, not a server timeout.
Not as a single input -- this tool expects one JSON document, so pasting several values back to back produces an error naming NDJSON as the likely cause. Minify each line separately instead.