ModernCalcs

File Compressor (ZIP)

Bundle multiple files into a single, real DEFLATE-compressed .zip archive — entirely in your browser.

File Compressor: Build a Real ZIP Archive in Your Browser

This tool builds a standards-compliant .zip archive entirely on your device, using the browser's native Compression Streams API for genuine DEFLATE compression — the same technique used by desktop zip utilities. No files are uploaded anywhere; the compression happens locally and the result downloads directly.

Formula
ZIP = Local File Headers + Compressed Data + Central Directory + End Record

Each file is compressed independently with DEFLATE (method 8), or stored uncompressed (method 0) as a fallback.

How Browser-Native Compression Works

Modern browsers expose a CompressionStream('deflate-raw') API that runs the same DEFLATE algorithm used by gzip and zip tools, directly in JavaScript without any external library. This tool feeds each selected file through that stream, then wraps the compressed bytes in a standard ZIP container structure.

The ZIP File Format, Briefly

A ZIP file is three parts: a local file header plus compressed data for each entry, a central directory listing every entry's name, size, and offset, and a short 'end of central directory' record at the very end that tells the reader where the central directory starts. This tool writes all three sections byte-for-byte to produce a file that opens correctly in any standard unzip tool.

When Compression Falls Back to Storage

If a file doesn't compress well (already-compressed formats like JPEG, MP4, or another ZIP), or if the compressed result would actually be larger than the original, the tool automatically stores that file uncompressed instead — the same behavior most zip utilities use to avoid wasted overhead.

Practical Examples

Bundling Downloaded Attachments

Combining several files into one download.

  • 1.Select 5 PDF invoices
  • 2.Click Compress to ZIP
  • 3.Download archive.zip
  • 4.Opens normally in Explorer/Finder

Compressing Text-Heavy Files

Log files and JSON compress especially well.

  • 1.Select a 2MB log file
  • 2.DEFLATE typically reduces text files 60-80%
  • 3.Resulting entry stored with method 8 (deflate)

What's Included in Every Archive

  • CRC-32 checksum per file, for integrity verification
  • Original file size and modified time
  • UTF-8 filenames, so non-ASCII names are preserved
  • Standard local + central directory structure, openable anywhere

Good Use Cases

  • Bundling multiple downloaded files before sharing
  • Compressing log files or text exports for email attachment limits
  • Creating a portable archive without installing zip software
  • Quick client-side compression for privacy-sensitive files

Frequently Asked Questions

Are my files actually uploaded to a server?

No. The entire ZIP file is built inside your browser using the native Compression Streams API. Your files never leave your device.

Is this real compression, or just bundling?

It's real DEFLATE compression, using the browser's built-in CompressionStream API — the same algorithm used by standard ZIP tools. If your browser doesn't support it (older Safari), the tool falls back to storing files uncompressed so the archive still works.

Will the resulting .zip open in Windows/Mac/any zip tool?

Yes. It's a standards-compliant ZIP file with a proper local file header, central directory, and end-of-central-directory record — the same structure produced by any standard zip utility.

Is there a file size or count limit?

Only whatever your device's available memory allows, since everything is processed in browser memory rather than streamed to a server.

Can I remove a file before compressing?

Yes. Use the X button next to any selected file to remove it from the batch before you click Compress.

Does this preserve folder structure?

If you select files via a folder-aware file picker that provides a relative path, that path is preserved in the archive. A flat file selection uses just the file name.

Why would I use this instead of my OS's built-in zip feature?

It's handy when you're already in the browser working with files (e.g. downloaded attachments) and want to bundle a few of them without switching to a file manager — everything stays in one tab.