JSON Minify
Minify JSON by removing all whitespace
How to Use JSON Minify
- Open JSON Minify above — it loads instantly, no signup or download required.
- Provide your input (paste text, drop a file, or type directly into the tool).
- Get your result instantly — everything is processed locally in your browser and nothing is uploaded.
- Copy or download the output. Refresh the page to clear all data from memory.
About JSON Minify
What this page solves
You need to embed JSON in a URL parameter, a QR code, a cookie, a `data-*` attribute, or an environment variable — and every byte counts. JSON Minify strips all whitespace and shrinks the payload to the smallest valid output, all in your browser.
JSON Minify strips every byte of optional whitespace from a JSON document — newlines, spaces, indentation, trailing spaces inside arrays and objects — and returns the smallest valid output, directly in your browser, so a 12 KB indented config drops to a 7 KB payload ready to embed in a URL, a QR code, a session cookie, a `data-*` attribute, or a `JSON_CONFIG` environment variable. Paste JSON, upload a file, or fetch a URL, and the tool parses with native `JSON.parse`, then re-emits with `JSON.stringify(value)` (no indent argument) — the canonical minified form every JSON consumer accepts. The stats panel shows exact byte savings so you can confirm the new size fits whatever budget you are working against. Most engineers reach for this when packing config into a QR code with the QR Code Generator, embedding pre-rendered server state into an HTML page to skip a round-trip, fitting a JWT custom-claims payload under the cookie size limit, or building a tiny webhook body for a service that bills per request byte. Pair it with the Base64 Encoder when the minified JSON also needs URL-safe encoding, the JSON Formatter to reverse the operation later, or the JSON Pretty Print tool for the inverse workflow. Runs entirely in your browser — no upload, no signup, no logs.
Common Use Cases
- Compress JSON config to fit inside a QR code under the 2 953-byte alphanumeric limit
- Pack pre-rendered state into an HTML `data-*` attribute to skip an extra fetch
- Trim a JWT custom-claims payload to stay under the 4 KB cookie size cap
- Shrink a webhook body for a service that bills per request byte (Twilio, SNS)
- Reduce JSON in a URL query parameter to stay under the 2 048-character browser cap
- Strip whitespace from a `package.json` before pasting it into a constrained config field
Related tools in Developer Tools
- JSON FormatterFormat, beautify and validate JSON data
- JSON ViewerBrowse JSON as a collapsible tree with syntax colors
- JSON ParserParse JSON and inspect keys, arrays, depth and node count
- JSON Pretty PrintPretty print JSON with 2 or 4 space indent
See all Developer Tools.
Frequently asked questions
How to use JSON Minify?
1) Open the tool. 2) Enter or upload your input. 3) Get your result instantly. Everything happens locally — nothing is uploaded.
When should I use JSON Minify?
Use it to compress a JSON payload before storing it somewhere with a size limit, sending it over a constrained channel, or embedding it inline in HTML.
Is JSON Minify safe?
Yes. JSON Minify runs 100% in your browser. Inputs are never uploaded, stored, or logged — safe for confidential content.
Will quality be affected by JSON Minify?
JSON Minify performs lossless operations — your content is not re-encoded or downgraded.
What formats does JSON Minify support?
JSON Minify supports JSON, YAML, XML, CSV, TOML and other developer-friendly text formats
Is JSON Minify free?
Yes — JSON Minify is completely free, with no registration, no watermarks, and no usage limits.
How much smaller does minification typically make a JSON file?
Roughly 20–40% smaller for indented JSON. A 2-space indented file with 100 keys typically loses 15–25 bytes per object/array opening. Larger documents with deeper nesting save more in absolute terms, less in percentage terms.
Is the minified output still valid JSON?
Yes — bit-perfect valid. Whitespace outside string values has no semantic meaning in JSON, so `{"a":1}` and `{ "a": 1 }` parse to the exact same value in every standards-compliant parser (Node, Python, Go, Java, browsers).
Can I minify and Base64-encode in one step for a URL parameter?
Minify here first, then paste the result into the [LINK:Base64 Encoder|/tool/base64-encoder-decoder]. For URL-safe Base64 (replace `+` with `-` and `/` with `_`), pick the URL-safe option in that tool. The two-step flow gives you the smallest URL-safe encoded JSON possible.
Does it preserve duplicate keys or comments?
Duplicate keys: only the last value survives (this is how `JSON.parse` works in every browser — duplicates are not legal JSON). Comments: not supported, since strict JSON does not allow them. If your input is JSONC or JSON5, strip the comments first with a regex or use the [LINK:JSON Formatter|/tool/json-formatter] to surface the parse error.