DevKitBase
ToolsAboutPrivacy

Minify JSON when pretty-print is just dead weight

Pretty JSON is for reading; minified JSON is for wires and caches. Paste valid JSON, get a compact string with the same structure.

chars: 27
Input
Output

When to use

Shrinking fixtures for fixtures folders, fitting a body under a size limit, or undoing a beautify before you paste into an API client.

Examples

Input
{
  "a": 1,
  "b": [2, 3]
}
Output
{"a":1,"b":[2,3]}
Input
{"msg":"keep  spaces"}
Output
{"msg":"keep  spaces"}
String contents stay as-is.

How it works

JSON.parse then JSON.stringify with no space argument. Values inside strings are untouched; only insignificant whitespace between tokens is removed.

Common pitfalls

  • Invalid JSON won’t minify — you’ll get a parse error.
  • Minify ≠ gzip; wire compression is separate.
  • Key order follows the engine; don’t rely on reorder for diffs.

How this differs

Minify compacts. Formatter expands. Validator checks syntax before either.

FAQ

Will minify change values?
No — only insignificant whitespace between tokens.
What if JSON is invalid?
Show parse error; don’t silently “minify” broken text.
Binary/base64 inside strings?
Untouched; strings are opaque.
Related to gzip?
Minify ≠ compression; gzip is separate.

Related tools

Runs in your browser. Nothing is uploaded. Not a security product —hashes and JWT decode are for debugging, not password storage or auth advice.