Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

tar vs 7z vs zip: Which Archive Format to Use

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Use tar when you need to preserve Unix file permissions and ownership or bundle files for Linux; use 7z when you want the smallest file size and strong encryption; use zip when you need universal compatibility with no extra software on Windows, macOS, or phones. The right choice depends on your operating system, whether the archive must be opened by someone else, and how much you care about compression ratio versus convenience.

What You'll Need

  • A computer running Windows, macOS, or Linux.
  • Command-line access (Terminal on macOS/Linux, Command Prompt or PowerShell on Windows).
  • Optional: 7-Zip installed on Windows (free, official site 7-zip.org) or p7zip on Linux. macOS can extract 7z with The Unarchiver or Keka from the Mac App Store.

Step-by-Step

  1. Identify your goal. If you are sending files to a Windows user who may not have extra software, choose zip. If you are archiving a Linux filesystem and need to keep permissions, choose tar (usually tar.gz). If you need maximum compression or password protection, choose 7z.
  2. Create a zip archive. On Windows, right-click the file or folder and choose Send to > Compressed (zipped) folder. On macOS, right-click and choose Compress. On Linux, run zip -r archive.zip folder/. Zip is built into Windows and macOS, so the recipient can open it without installing anything.
  3. Create a tar archive. On macOS or Linux, run tar -czvf archive.tar.gz folder/. The flags mean: c = create, z = gzip compression, v = verbose (list files), f = filename. To extract, run tar -xzvf archive.tar.gz. Tar preserves Unix permissions and ownership, which zip does not do reliably.
  4. Create a 7z archive. Install 7-Zip, then right-click the folder and choose 7-Zip > Add to "folder.7z". On the command line, run 7z a archive.7z folder/. To extract, run 7z x archive.7z. 7z typically produces smaller files than zip, especially for large text or mixed data.
  5. Add password protection if needed. Zip supports password protection but with weaker encryption (ZipCrypto) in many tools; 7z supports AES-256. In 7-Zip, enter the password in the Add to Archive dialog and choose AES-256. Tar itself does not encrypt; you would combine it with gpg or openssl. Note that zip password protection is not available in Windows' built-in Compress option; you need a third-party tool like 7-Zip.
  6. Test the archive before sending. Extract it to a temporary folder and open a few files. This catches corruption or missing files early.
  7. Choose the right format for sharing. If the recipient uses Windows and you cannot confirm they have 7-Zip, send zip. If they use Linux or macOS, tar.gz is fine. If file size matters (email limits, cloud storage), use 7z and tell the recipient to install 7-Zip or The Unarchiver.

Common Mistakes

  • Assuming zip preserves Linux permissions. It does not; tar does. If you zip a Linux folder and extract it elsewhere, executable bits and ownership may be lost.
  • Sending a 7z file to someone without 7-Zip. Windows cannot open 7z natively; the recipient will see an unknown file type. Always mention the required tool.
  • Using tar on Windows without a tool. Windows has no built-in tar extraction for .tar.gz in older versions; Windows 10 and 11 include tar.exe, but it may not handle all options. Use 7-Zip or WSL if unsure.
  • Forgetting that tar.gz is two steps. Tar bundles files; gzip compresses the bundle. You can also use tar.bz2 or tar.xz for better compression, but they are slower.
  • Relying on zip encryption for sensitive data. Standard zip encryption is weak; use 7z with AES-256 or encrypt the archive with gpg.

Tips

  • For cross-platform sharing with no fuss, zip is the safest default.
  • For backups on Linux, tar.gz preserves metadata and is script-friendly.
  • For the smallest archive of large datasets, 7z usually wins, but compression time is longer.
  • If you need both compression and encryption, 7z with AES-256 is a solid choice.
  • When emailing, split large archives into volumes: 7z supports -v for volume sizes, and zip can be split with third-party tools.

Troubleshooting

  • "Archive is corrupt" when extracting. Re-download the file; if it still fails, the archive may have been created with a tool that used non-standard headers. Try 7-Zip or The Unarchiver.
  • Permission denied on Linux after extracting a zip. Zip does not store Unix permissions; use tar instead, or manually chmod files after extraction.
  • 7z file won't open on a Mac. macOS does not include 7z support; install The Unarchiver or Keka from the Mac App Store.
  • Password not accepted. Check keyboard layout and caps lock; if the archive was created on Windows with a non-ASCII password, try typing it in the same encoding or use 7-Zip on both ends.
  • tar command fails with "Cannot open: No such file or directory". Verify the path and that you have read permissions; use ls to confirm the file exists.

Frequently Asked Questions

Can Windows open tar.gz files without extra software?

Windows 10 (version 1803 and later) and Windows 11 include tar.exe, which can extract tar.gz from Command Prompt. However, it may not handle all options; 7-Zip is more reliable for GUI users.

Is 7z always smaller than zip?

Usually, but not always. 7z uses LZMA2 compression, which typically beats zip's Deflate, especially on large text files. For already-compressed files like JPEGs, the difference is minimal.

Does zip support AES encryption?

Standard zip uses ZipCrypto, which is weak. Some tools support AES-256 in zip format (WinZip, 7-Zip), but compatibility varies. For strong encryption, use 7z.

Can I convert between formats?

Yes. Extract the archive and re-create it in the desired format. 7-Zip can also convert archives directly via its interface.

Which format is best for long-term archiving?

For long-term storage, zip and tar.gz are widely supported and unlikely to become obsolete. 7z is also stable but requires specific software. Consider open formats like tar for critical data.

Does tar compress files?

Tar itself only bundles files; compression is added by gzip (tar.gz), bzip2 (tar.bz2), or xz (tar.xz). A plain .tar file is larger than the original files combined.