JSON Minifier & Compressor

Zero-whitespace RFC 8259 output · UTF-8 byte savings meter · 100% browser-local

JSON Input
0 B
Minified JSON
0 B

        
Ready
Cmd/Ctrl+Enter to run · 100% browser-local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

When to Minify JSON Payloads in Production Workflows

Minifying JSON removes all insignificant structural whitespace—indentation spaces, line breaks, and spaces after colons or commas—without altering a single byte inside string values. For deeply nested configurations or arrays of objects, minification routinely cuts raw wire size by 25% to 45% before HTTP Brotli or Gzip compression is applied.

Single-line minified JSON is also mandatory when passing JSON blobs into environment variables (such as Docker Compose, GitHub Actions secrets, or AWS Secrets Manager), NDJSON/JSONL log pipelines, or single-quoted cURL -d request bodies. Because this tool executes purely via browser-local parsing and TextEncoder, credentials and service-account snippets never leave your machine.

  • Compression MechanismCanonical JSON.stringify(parsed) stripping insignificant spaces, tabs, and CRLF/LF newlines
  • Size MetricsMeasures exact UTF-8 bytes via TextEncoder (handling multibyte emojis/CJK accurately) and percentage saved
  • Data IntegrityPreserves all whitespace inside string values verbatim while eliminating structural formatting overhead
Does minifying JSON alter spaces inside string values?

Never. Only insignificant structural whitespace outside string literals is removed; every space, newline escape (\n), and Unicode character inside strings remains untouched.

Why does byte count sometimes differ from character count?

JavaScript string.length counts UTF-16 code units, whereas HTTP Content-Length measures UTF-8 bytes. Non-ASCII characters take 2 to 4 bytes in UTF-8.

Should I minify JSON if my API already uses Gzip or Brotli?

Yes for high-throughput APIs and caches (like Redis or DynamoDB) where uncompressed payloads consume RAM, storage quotas, and client parser CPU cycles.