Compress Files to ZIP (and Unzip)
Compress files or whole folders into a ZIP and see, file by file, how much each one really shrank. Or open a ZIP to list, check and extract it. Everything runs in your browser; nothing is uploaded.
How to Use
- Choose Compress to ZIP, then drop files or a whole folder on the box (or use Add files / Add folder). Folder paths are kept inside the ZIP.
- Pick a compression level. 6 is the normal default; 9 squeezes a little more and takes longer; 0 only bundles the files without compressing.
- Press Build ZIP. The table shows each file’s original size, its size inside the ZIP, the percentage saved and a plain verdict, and the archive downloads.
- To unzip, switch to Open / Unzip and drop a .zip. Every entry is listed with its method, ratio, date and CRC-32, and anything risky is flagged: passwords,
../path tricks, zip-bomb ratios, damage. - Download one file or press Save all. Each file is size- and CRC-checked as it comes out.
Compress Files to ZIP (and Unzip)
Files to compress
Worked Example
A 10 MB CSV. An orders export of 10,485,837 bytes (10.00 MB), zipped at level 6, is stored as 1,616,879 bytes (1.54 MB).
Saved = 1 − 1,616,879 ÷ 10,485,837 = 84.6%. Ratio = 10,485,837 ÷ 1,616,879 = 6.49:1.
The whole .zip is 118 bytes bigger than the compressed data: a 30-byte local header and a 46-byte directory entry, each followed by the 10-byte name, plus the 22-byte end record.
A 1.53 MB JPG photo (1,602,752 bytes) is stored as 1,586,959 bytes. Saved = 1 − 1,586,959 ÷ 1,602,752 = 1.0%, just 15,793 bytes.
The common mistake: zipping a folder of holiday photos or phone videos to get them under an email limit. At about 1% saving, 120 MB of JPGs becomes roughly 119 MB — still far over a 25 MB limit. ZIP is the wrong tool for that; reduce the photos with the Image Compressor or the video with the Video Converter, or send a link instead.
What other files did, measured the same way (level 6, this page’s ZIP library):
| File | Original | In the ZIP | Saved |
|---|---|---|---|
| Web server log (text) | 5.00 MB | 541.3 KB | 89.4% |
| Orders export (CSV) | 10.00 MB | 1.54 MB | 84.6% |
| Windows sound (WAV, uncompressed audio) | 1.08 MB | 813.9 KB | 26.4% |
| Word document (DOCX) | 21.6 KB | 18.2 KB | 15.7% |
| Spreadsheet (XLSX) | 27.2 KB | 23.4 KB | 14.1% |
| PDF manual (text, fonts, 6 images) | 305.0 KB | 295.1 KB | 3.2% |
| Windows wallpaper photo (JPG) | 1.53 MB | 1.51 MB | 1.0% |
| Detailed 1254×1254 image (PNG) | 3.67 MB | 3.65 MB | 0.3% |
| PDF holding one JPEG image | 573.3 KB | 572.3 KB | 0.2% |
| Detailed 1254×1254 image (JPG) | 1.72 MB | 1.72 MB | 0.1% |
The small DOCX and XLSX gained 14–16% only because they are ZIPs themselves: most of what DEFLATE found was their own internal list of file names. The document text inside was already compressed.
Show Work
Formulas
How ZIP and DEFLATE Work
ZIP comes from PKWARE, the company Phil Katz founded; his PKZIP program for DOS was its first implementation. PKWARE’s own specification, APPNOTE.TXT, dates the format’s first publication to 1989 and is still maintained (version 6.3.10, 2022). A ZIP is a series of entries, each a small local header followed by that file’s data, and a central directory at the end that lists every entry with its sizes, CRC-32 checksum, date and position. That is why this page can list a ZIP by reading only its last few kilobytes, and why a ZIP cut short by a broken download usually cannot be listed at all.
Each entry records its own compression method. The specification numbers 0 as stored and 8 as Deflate, and also defines BZIP2, LZMA, Zstandard and others; method 99 marks WinZip-style AES encryption, and bit 0 of the flags marks an encrypted entry. Almost every ZIP in use is Deflate, which arrived with PKZIP 2 in 1993 and was published as an open specification by L. Peter Deutsch as RFC 1951 in May 1996.
DEFLATE works in two steps. First, LZ77 finds stretches that already appeared within the previous 32 KB and replaces each with a back-reference: copy length bytes from distance bytes back. Then Huffman coding gives the most frequent letters and references the shortest bit patterns. Text, CSV and logs are full of repeats and skewed letter frequencies, which is why they shrink 80–90%. RFC 1951 itself notes that English text usually compresses by a factor of 2.5 to 3, and that no lossless method can compress every input: on data with no pattern left, DEFLATE costs at most 5 bytes per 32 KB block.
That is the whole story behind already-compressed files. A JPEG, MP4, MP3 or PNG has been through its own compressor (PNG even uses DEFLATE internally), so its bytes look random and LZ77 finds no repeats. Zipping such a file measures 0–1% smaller; the only way to make it much smaller is to re-encode it with a lossy setting, which changes the picture or sound.
Sources: PKWARE, .ZIP File Format Specification (APPNOTE.TXT) 6.3.10, sections 1.1, 4.3 and 4.4; L. P. Deutsch, RFC 1951: DEFLATE Compressed Data Format Specification 1.3, May 1996; D. Fifield, “A better zip bomb”, USENIX WOOT 2019 (overlapping-entry bombs).
About This Tool
This page builds standard ZIP files with DEFLATE at the level you choose, using the open-source JSZip library, then reads the finished archive back so the size shown for every file is the size actually stored, not an estimate. It never promises a saving: each file gets a measured percentage and a plain verdict, and when a ZIP would not make something smaller, it says so and points to a tool that can.
Opening a ZIP works the other way round: the page reads the archive’s central directory itself, so it can list password-protected entries, unusual compression methods and damaged archives instead of failing on them. It flags ../ path tricks, very high ratios and overlapping entries before anything is decompressed, inflates each file with your browser’s built-in decoder, stops at the declared size, and checks every CRC-32.
Privacy: everything runs in your browser. Your files are never uploaded; the page makes no network request with them, and it keeps working with your connection switched off once it has loaded.
For people emailing exports, sending folders, or checking an attachment before opening it. More on why some files compress and others do not: Lossy vs Lossless Compression.
Related tools: Image Compressor, Video Converter, and File Splitter.
Frequently Asked Questions
Why didn’t my photos, videos or PDFs get smaller in the ZIP?
Because they are already compressed. JPEG, PNG, MP4, MP3 and most PDFs have had their redundancy squeezed out by their own codecs, and DEFLATE cannot remove it twice. Measured with this page: a 1.53 MB JPG came out 1.0% smaller, a 3.67 MB PNG 0.3% smaller. Text is the opposite: a 10 MB CSV dropped 84.6%. To make photos smaller, re-encode them with the Image Compressor; for video, use the Video Converter.
Which compression level should I use?
Level 6, the default, for almost everything. On a 10 MB CSV, level 1 gave 2.17 MB, level 6 gave 1.54 MB and level 9 gave 1.51 MB, while level 9 took about 1.8 times as long as level 6. Level 0 (store) does not compress at all; it is for bundling files that will not shrink anyway, and it is the fastest.
Is there a size limit, and are my files uploaded?
Nothing is uploaded: files are read and zipped by your browser, and the finished ZIP is handed straight back to you. Because the files and the ZIP both sit in the tab’s memory, the page asks you to confirm above 1 GB of input and stops at 2 GB or 60,000 files. When opening a ZIP it inflates at most 1 GB per file and 2 GB for Save all.
Can it open password-protected ZIPs?
It lists them and tells you exactly which entries are encrypted (classic ZipCrypto or AES), but it cannot decrypt them: the ZIP library this page uses has no decryption. Open the archive in 7-Zip, or in Windows Explorer or macOS Archive Utility for classic ZipCrypto, and type the password there. Unencrypted entries in the same archive can still be extracted here.
What are zip bombs and zip slip, and how does this page handle them?
A zip bomb is a small archive built to expand to gigabytes, either with an extreme ratio (DEFLATE tops out near 1,032:1) or with many entries sharing one block of data. Zip slip is an entry named like ../../evil.txt that would be written outside the folder you extract to. This page flags any file over 100:1, flags overlapping entries, stops any file that inflates past its declared size, and saves path-trick entries under a cleaned name.
Common Use Cases
Shrink a data export before emailing it
CSV, JSON and log files compress hard: a 10 MB orders CSV zipped to 1.54 MB, and a 5 MB web-server log to 541 KB (89% smaller).
Send a folder as one file
Drop a project folder and its sub-folders go into the ZIP with their paths, so it unpacks into the same structure on the other end.
Check whether zipping is worth it
The verdict column says plainly when a file won’t shrink. 40 JPGs that save about 1% each will not get under a 25 MB email limit by zipping; resize or recompress them instead.
Inspect a ZIP before you open it
See every name, size and ratio first. A ../ path, a password-protected entry or a 1,000:1 ratio is flagged before a single byte is unpacked.
Pull one file out of a big archive
Download just the entry you need; the page reads only that entry’s bytes and checks its CRC-32 instead of unpacking everything.
Last updated: