What is zlib compression?
Zlib (RFC 1950) is a thin 6-byte wrapper around the DEFLATE algorithm: a 2-byte header that signals the compression method and window size, followed by raw DEFLATE bytes, ending with a 4-byte Adler-32 checksum. It is the format used by PNG image chunks, Git object storage, Java JAR/ZIP entries, and the MySQL COMPRESS() function.
Why does the browser API call it deflate?
The Compression Streams spec uses the name deflate to mean "DEFLATE wrapped in zlib" (RFC 1950) — confusingly, this matches HTTP's Content-Encoding: deflate header, which most servers also implement as zlib. For raw RFC 1951 DEFLATE without any wrapper, use the deflate-raw format instead. This tool intentionally uses deflate (zlib) because it is the most interoperable.
Should I use gzip or zlib?
Use gzip when producing files (.gz), HTTP responses, or anything that will be decompressed by gunzip / standard CLI tools — it carries metadata and a CRC-32. Use zlib when storing compressed bytes inside another container (PNG, Git, JAR) where the surrounding format already handles framing — its 6-byte overhead is smaller than gzip's 18 bytes.
How does this tool work without a server?
Modern browsers ship CompressionStream (Chrome 80+, Firefox 113+, Safari 16.4+). The tool wraps your text in a Blob, pipes it through new CompressionStream("deflate"), and base64-encodes the resulting bytes — all locally in JavaScript.
How small will my data get?
Highly repetitive text (JSON with the same keys, XML, SVG, log lines) typically shrinks 60–85%. Random data (PNG pixels, encrypted blobs) does not compress because there is no redundancy. Small payloads under ~30 bytes can grow slightly because the 6-byte zlib overhead exceeds the savings.
Can Python or Node decompress this output?
Yes. In Python: import zlib; zlib.decompress(base64.b64decode(payload)). In Node.js: zlib.inflateSync(Buffer.from(payload, "base64")). In Java: java.util.zip.Inflater. The output is fully RFC 1950-compliant.
Is the input uploaded?
No. CompressionStream runs inside the browser process. Open DevTools Network tab and click Compress — you will see no requests fire. Sensitive payloads, secrets, and proprietary data never leave your device.
Why is my output base64 instead of raw bytes?
Compressed output is binary and contains bytes that cannot survive copy-paste, JSON encoding, or HTTP headers. Base64 turns the bytes into a 7-bit ASCII string that can be embedded anywhere — environment variables, JSON, URL parameters, YAML — without corruption.