The result appears here.How to use
Add your JSON
Paste formatted JSON into the JSON box, drop a file on it, press Upload .json or Load URL, or press Try sample to see a small indented object.
Pick the output and options
Choose Minified JSON, Escaped string or Beautified. Turn on Sort keys or Remove comments and trailing commas first if you need them, then press Minify, or tick Minify as you type.
Copy or download
Press Copy above the result, or Download to save a .min.json file (.txt for an escaped string). Check the byte counts under the panes to see how much smaller it got.
Why JSON Minifier
- Shows the input and output size in KB and exact bytes, plus the percentage saved.
- Copies numbers and key order exactly as written, so nothing but whitespace changes.
- Escaped string output gives you JSON ready to paste into another JSON value or a code string.
- Can strip comments and trailing commas first, and flags broken input on its exact line.
Before and after: how many bytes minifying saves
Here is the tool's sample record, a product with an id, name, price, stock flag and two tags, saved with different indentation and then minified. The byte counts are exact UTF-8 sizes, the same figures the tool shows under the panes.
The saving comes only from whitespace, so it grows with the indent width and the depth of nesting. The escaped string is larger than the minified JSON because every double quote gains a backslash, plus the two surrounding quotes.
Minifying does not reorder keys or change values, so you can check the output by pasting it into the JSON Formatter and comparing it with your original.
| Version | Size | Change vs 2-space |
|---|---|---|
| Indented with 4 spaces | 141 bytes | +17% |
| Indented with 2 spaces | 121 bytes | baseline |
| Indented with tabs | 111 bytes | -8% |
| Minified JSON | 87 bytes | -28% |
| Minified, as an escaped string | 105 bytes | -13% |
Minify, escaped string or beautified: which output to pick
The three output modes start from the same parsed JSON and differ only in how it is written. Pick the one that matches where the JSON is going next.
| Output | Looks like | Use it for |
|---|---|---|
| Minified JSON | {"id":1042,"tags":["a"]} | API bodies, config values, smaller files |
| Escaped string | "{\"id\":1042,\"tags\":[\"a\"]}" | A JSON document stored inside another string or JSON field |
| Beautified | Indented with 2 spaces, one key per line | Reading or reviewing the same data |