Why minify JSON
Pretty JSON is readable but bulky. Request bodies, env vars, and single-line logs usually need all insignificant whitespace removed.
ComTools JSON Minify (Tools/Json/Minify) parses in the browser, then JSON.stringify without indentation for a compact string.
Steps
- Open JSON Minify.
- Paste formatted or spaced JSON (or use Sample).
- Click Run.
- Copy the one-line result.
Invalid JSON shows a parse error—fix with the validator first.
Example
Input:
{
"name": "ComTools",
"free": true,
"tools": [
"json",
"excel"
]
}
Output:
{"name":"ComTools","free":true,"tools":["json","excel"]}
Common scenarios
| Scenario | Notes |
|---|---|
| HTTP payloads | Fewer bytes; cleaner gateway logs |
| Env vars / CI | Easier to paste as one line |
| Analytics / logging | One JSON event per log line |
| Inverse of format | Read with formatter; ship minified |
What minify does / does not
| Does | Does not |
|---|---|
| Remove indent, newlines, extra spaces | Rename keys or drop fields |
| Emit valid compact JSON | Shrink string contents |
| Validate syntax while parsing | Replace gzip/Brotli on the wire |
For smaller transfers, enable HTTP compression or remove unused fields—not minify alone.
Related tools
| Need | Tool |
|---|---|
| One line | JSON Minify |
| Readable again | JSON Formatter |
| Validity only | JSON Validator |
| Structural diff | JSON Compare |
Notes
- Must be standard JSON (double quotes, no trailing commas/comments).
- Numbers follow
stringifyrules (1.0may become1). - Local processing—avoid sensitive data on public machines.
FAQ
Looks different but same data?
Key order or number formatting may change; use compare for structural equality.
JSONL (one JSON per line)?
Minify each line separately; this tool handles one JSON value per run.
Spaces inside strings?
Preserved—only structural whitespace is removed.