🗂️Trifouille

How to create a ZIP file and compress a folder

Guides · ZIP archives · Updated

Creating a ZIP file does three things: it lets you send several files at once, it can save space, and it freezes a folder at a specific point in time. It takes ten seconds on every system. What deserves some thought is what you put inside and how it is organized.

Compress a folder on Windows

Select the item or items, right-click, then choose “Compress to ZIP file” on Windows 11, or “Send to → Compressed (zipped) folder” on Windows 10. The archive appears in the same place, and you can rename it right away.

To compress several scattered items, select them while holding Ctrl before right-clicking: they will all be placed at the root of the same archive.

Compress a folder on macOS

Right-click the folder, then choose “Compress”. A FolderName.zip file appears next to it. With several items selected, macOS creates an archive called Archive.zip: rename it immediately, or you will have three identical ones within a week.

macOS quietly adds technical files to the archive (__MACOSX, .DS_Store). They are harmless, but they clutter the archive when it is opened on Windows.

Create a ZIP from the command line

On Windows, PowerShell offers Compress-Archive -Path .\MyFolder -DestinationPath .\MyFolder.zip. It is handy in a script, but the version that ships with Windows cannot handle individual files larger than 2 GB.

On macOS and Linux, zip -r MyFolder.zip MyFolder compresses a folder recursively. Add -x '*.DS_Store' to leave out Finder metadata, which has no business in an archive meant for a PC.

Organize first or compress first?

An archive does not improve the organization of what it contains: it freezes it. A messy folder compressed becomes a messy archive, which you will have to sort out later, usually at the least convenient moment.

Two approaches work. Organize first, compress second: the cleanest option, but also the slowest. Or compress right away to free up the folder, then have the resulting archive organized by type or by date. That works especially well for an overflowing Downloads folder.

Traps to watch out for

The ZIP format carries limitations from its thirty-plus years of history. Very long paths cause trouble on Windows, which historically caps them at 260 characters. Accented and special characters in file names can come out garbled from one system to another, because the encoding was never standardized.

Beyond a few gigabytes, prefer several topic-based archives to one giant archive: faster to send, easier to resume if a transfer fails, and less risky if something gets corrupted.

  • Avoid accented and special characters in file names
  • Shorten paths before compressing on Windows
  • Split by topic rather than creating a 20 GB archive
  • Check the archive's contents before deleting the originals

ZIP, 7z or RAR: which format?

ZIP is still the only format everyone can open without installing anything. That settles it whenever you send the archive to someone else.

7z compresses better, often 10 to 30% smaller on documents and code, but the recipient needs software to open it. RAR is proprietary: creating RAR files requires a paid tool. For everyday use, ZIP is the right default.

ZIP file size limits

The original ZIP format caps out at 4 GB per file, 4 GB for the entire archive and 65,535 files. The ZIP64 extension, supported by every modern system, removes all three limits.

In practice, Windows, macOS and 7-Zip switch to ZIP64 automatically when needed. The problem only comes up with very old software, or embedded devices that were never updated.

Sending a large ZIP file

Most email services reject attachments larger than 20 to 25 MB. For a heavier archive, use a shared storage space (Google Drive, OneDrive, iCloud Drive) or a file transfer service, and send the link instead of the file.

Before sending, organize the archive: your recipient will open neatly sorted contents instead of discovering 800 files dumped at the root. It is the kind of care that really changes how a professional delivery is received.

Check the archive before deleting the originals

Open the archive and make sure it contains everything you expected, in the right folder structure. With 7-Zip, the “Test archive” command also verifies the integrity of every compressed file.

Only delete the originals after that check, and only if the archive exists in at least two places.

Try it on your own archive

Free up to 200 MB, no sign-up. Your files are not kept.

Organize my ZIP

Frequently asked questions

Does zipping reduce file quality?

Never. ZIP is lossless compression: extracted files are strictly identical to the originals, byte for byte.

Why isn't my ZIP file any smaller?

Because its contents are already compressed. JPEG, PNG, MP3, MP4 and recent PDF files barely compress any further. In that case the ZIP bundles files, it does not shrink them.

Can I add a password to a ZIP file?

Not with the built-in tools in Windows or macOS. You need 7-Zip on Windows, or the zip -e command in Terminal on macOS and Linux.

Can I edit a file directly inside a ZIP?

Not reliably. Extract the file, edit it, then replace it in the archive or create the archive again. Working directly from the preview of an open ZIP risks losing your changes.

More guides: ZIP archives

For the big picture, start with How to organize a messy ZIP file.