Why is my ZIP file larger than the files I put in?
You zipped 180 MB of photos and the archive is 181 MB. Nothing ate your files: the wrapper itself takes a little room, and the photos had nothing left to fold.
Where the extra bytes come from
Think of a ZIP as a box of labelled envelopes:
- Each file starts with a local header of 30 bytes, plus the file name and any extra fields (timestamps, UTF-8 flags).
- Then come the file bytes, either stored as-is or run through Deflate, followed by a CRC-32 checksum.
- At the end sits the central directory: another 46 bytes plus the file name for every entry, and a 22-byte end-of-directory record.
Per file that is roughly 76 bytes plus twice the length of the name, before counting optional extra fields. A hundred photos named IMG_0123.JPG add about 10 KB of labels. Against 300 MB of pictures that is nothing; against a folder of tiny already-packed files it is noticeable.
When the data itself grows
Deflate works by finding repeated patterns. Already-packed data looks almost random, so there is nothing to point back at. The compressor still writes a short Huffman table describing “I found no useful repeats”, and that table can make each entry a few bytes larger than storing the file untouched. Many tools notice and switch to the store method; some always deflate, which is why one ZIP program can produce a slightly bigger file than another for the same photos.
The interactive lesson at learn.oddlathe.com/packing shows the extreme case with TV snow: true randomness has no pattern, so the packed file grows by the size of its header.
A rough worked example
| What you zip | What usually happens |
|---|---|
| 100 JPEG photos, 3 MB each (300 MB) | ZIP of about 300 to 309 MB (headers, almost no Deflate saving) |
| The same photos after resizing to 1920 px | Perhaps 15 to 30 MB of JPEGs, then a ZIP of almost the same size |
A 20 MB folder of .csv, .json and logs | Often 3 to 8 MB — Deflate has patterns to fold |
| Ten tiny 2 KB JSON files | The ZIP may beat the files, or lose, depending on how compressible each one is versus ~100 bytes of labels |
| A ZIP inside another ZIP | Almost always a little larger. Do not nest archives to save space |
This is not the same as a damaged ZIP
A healthy oversized ZIP still opens, lists every file, and survives unzip -t archive.zip. If extraction stops with “CRC failed” or “unexpected end of archive”, the file was cut off or altered in transit — see CRC failed / unexpected end of archive. Size alone does not tell you which case you have.
What to do instead
- If you wanted a smaller folder of photos, resize and re-encode them, then zip for convenience. The batch compressor guide walks through doing that in your browser without uploading anything.
- If you wanted one file to send, a slightly larger ZIP is doing its job as an envelope. That is useful even when it does not save space.
- If the originals were text, CSV or source code and the ZIP still grew, check you did not accidentally zip files that were already
.zip,.gz,.pngor.pdf— or zip the archive you just made.
Related
Lossless vs lossy compression · gzip vs ZIP · CRC failed / unexpected end of archive · Why zipping photos barely makes them smaller (interactive lesson) · Why zipping photos does not make them smaller · Compress many photos at once · Compress an image without uploading it · Image compressor
Questions
Why is my ZIP file larger than the original files?
ZIP adds a header and a directory entry for every file. If those files are already compressed (photos, video, PDFs, another ZIP), Deflate cannot shrink them, so the labels make the archive a little bigger than the folder — often by 1 to 3%.
Does a bigger ZIP mean the file is corrupt?
No. A complete ZIP can legitimately be larger than its contents. Corruption shows up as a CRC failure, “unexpected end of archive”, or a file that will not list its contents.
Will 7z or RAR make an already-compressed folder smaller?
Only by a percent or two, and sometimes they also grow. No lossless archiver can do much once the files look like random bytes.
Why did zipping one photo make it bigger?
The JPEG was already packed. The ZIP then added a header, a checksum and a directory record — a few dozen extra bytes, which you notice more on a single small file than on a huge folder.
Should I zip a ZIP to save more space?
No. The inner archive is already compressed, so the outer one almost always grows.
Published .