JSON Minify Online: Compress to a Single Line

2026-07-20

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

  1. Open JSON Minify.
  2. Paste formatted or spaced JSON (or use Sample).
  3. Click Run.
  4. 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.

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 stringify rules (1.0 may become 1).
  • 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.


中文版