How To Compress and Extract Files on Any Operating System

Compressing (zipping) and extracting (unzipping) files are easy ways to download and transfer large files. Learn how to compress and extract files on any device, whether on Windows, macOS, Android, iOS, or even Linux.
We receive compensation from the products and services mentioned in this story, but the opinions are the author's own. Compensation may impact where offers appear. We have not included all available products or offers. Learn more about how we make money and our editorial policies.

Understanding how to compress and extract files has practical uses when you want to quickly reduce a file size or return it to its original size. Compressing (zipping) and extracting (unzipping) files are convenient ways of downloading and transferring large files.

Explore our guide below on how to incorporate the best practices to compress and extract files. While you’re here, discover the best antivirus software with VPNs to safeguard against downloading malicious files while protecting your privacy for the utmost security.

In this article
Why zip and unzip files?
How to compress and extract files on Windows
How to compress and extract files on macOS
How to compress and extract files on Linux
How to compress and extract files on ChromeOS
How to compress and extract files on iOS
How to compress and extract files on Android
How to safely download, share, and store files
FAQs
Bottom line

Why zip and unzip files?

The main reason why people compress files is to reduce the size of a large file or multiple files so as not to use up all their storage space. If you download large files from the internet and want to transfer them to another computer or send them in an email, it’s easier if the files are compressed; otherwise, the process takes much longer.

When you extract files, it is the complete opposite of compressing them. This process lets you return a compressed file to its original size, usually with a simple right-click. It is very practical for viewing large files, like high-resolution videos or images. Extracted files are uncompressed files since they have been restored to their original size.

The terms “compress” and “zip” are often used interchangeably, but they have a slightly different meaning. While compressing refers to the process of reducing a file’s size, zipping refers to the act of compressing using the (.zip) format. Programs like WinZip, 7-Zip, and RAR ZIP are commonly used. Similarly, “extract” and “unzip” are also used interchangeably. While extracting a file returns it to its original size, unzipping uses the (.zip) format to do this.

How to compress and extract files on Windows

On Windows operating systems, you can decompress a variety of compressed file formats. However, you can only compress files to the (.zip) file format.

Here's how to compress files on Windows:

  1. Go to File Explorer. You can find it by searching for it in the Start menu, clicking its icon on the taskbar, or pressing Windows + E on your keyboard.
  2. Right-click the file you want to zip and select Send to the Compressed (zipped) folder. This will compress the file.

Follow these steps to extract files on Windows:

  1. Open File Explorer. Then search for the compressed folder.
  2. To unzip the compressed folder, right-click and select Extract All. Then select a location where you want to extract the files to.
  3. In order to decompress a single file or folder, just double-click the compressed folder and open it.
  4. Drag the item or click copy from the compressed folder to the location of your choice.

How to compress and extract files on macOS

On the macOS operating system, it’s a three-step process to compress and extract files. 

Here’s how to compress or decompress files on macOS:

  1. Search for the file or folder you want to compress.
  2. Right-click on the file or folder. Then select Compress <name of file or folder>. This will compress the file into a (.zip) file format.
  3. A screenshot of compressing files on macOS

    A screenshot of a compressed .zip file on macOS

  4. To extract the file, double-click on the (.zip) file to decompress it.
  5. A screenshot of double clocking the extracted .zip file on macOS

    A screenshot of a (.zip) file that has been extracted to its original (.pdf) format and size. on macOS

How to compress and extract files on Linux

Most Linux users are familiar with the command line and use it for file compression and extraction. This is often done with the gunzip (.gzip) and tarball (.tar.gz) file formats, which are similar to the zip (.zip) file extension.

In the following sections, we will provide step-by-step instructions on how to compress and extract files with the popular formats Linux uses.

Compress and extract files with gunzip (.gzip)

Follow these simple steps to compress and extract files with gunzip.

To compress files:

  • Open the Terminal.
  • From the command line, type gzip filename.

To decompress files:

  • Use the command gunzip filename.gz or gzip -d filename.gz.

Compress and extract files with tarball (tar.gz)

Follow these simple steps to compress and extract files with tarball.

To compress files:

  • Enter the command tar -czvf archive_name.tar.gz directory_to_compress. (Tip: archive_name.tar.gz is the name of the compressed archive, and directory_to_compress is the directory you wish to compress.)

To extract files:

  • Enter tar -xzvf archive_name.tar.gz in the command line. Take note that the tarball filename archive_name.tar.gz is the name of the archive you wish to extract.

Zip and unzip files on the Linux command line

Follow these steps to compress and extract files using Zip from the command line.

To compress (.zip) files on Linux:

  • Open the Terminal to access the command line.
  • From the command line, navigate to the directory containing the files or folders you want to compress.
  • For files, use the command zip archive_name.zip file_to_compress.
  • For folders, use the command zip -r archive_name.zip folder_to_compress to compress a folder. Then replace archive_name.zip with your desired archive name and folder_to_compress with the name of the folder you want to compress.

To extract (unzip) files on Linux:

  • From the Terminal, type the command unzip archive_name.zip, replacing archive_name.zip with the name of your zip file. This extracts the file into the current directory.

How to compress and extract files on ChromeOS

Here’s how to zip files on ChromeOS:

  • Open the app launcher and click Files.
  • Select the files you want to zip.
  • Right-click on them and select Zip selection.

Follow these steps to unzip files on ChromeOS:

  • Double-click the archive.zip file.
  • Select and right-click the files you want to extract, and then click Copy.
  • Go to the location where you want to extract the files. Right-click and select Paste.
  • When done, click Eject next to the archive.zip folder.

How to compress and extract files on iOS

How to compress files in iOS:

  • Open the Files app on your iPhone or iPad.
  • Locate the file or folder you want to compress.
  • Press and hold the file or folder.
  • Tap Compress in the menu that appears.
  • Find the new zip file saved in the same location as the original.

How to decompress files in iOS:

  • Launch the Files app on your iPhone or iPad.
  • Search for the zip file you wish to open.
  • Press and hold the zip file.
  • Select Uncompress from the menu.
  • Access the uncompressed files in the same spot as the zip file.

How to compress and extract files on Android

Android does not have a built-in native feature that allows you to compress files. Instead, Android users must download a third-party app to compress or zip files from the Google Play Store. Popular file apps include Files by Google, ZArchiver, and RAR.

We’ll provide a step-by-step guide on how to zip files on Android using ZArchiver and how to unzip files using Files by Google.

How to zip files on Android with ZArchiver

  • Download ZArchiver from the Google Play Store.
  • Open ZArchiver and navigate to the folder where your files are located.
  • Select the files or folder you want to zip.
  • Tap on the Compress option in the menu.
  • Enter a name for your zip file and confirm by tapping OK.
  • Your zip file will be created in the same location as the original files.

Unzip files on Android with Files by Google

  • Ensure Files by Google is installed on your device. Otherwise, download it from the Google Play Store.
  • Open the app and locate the zip file you wish to unzip.
  • Tap on the zip file. Files by Google will automatically show their contents.
  • Select Extract to unzip the files into the current folder, or choose Extract to… so you can pick a different location.
  • Once extracted, access your files directly from the chosen folder.

How to safely download, share, and store files

With so many threats looming on the web, it’s crucial to safeguard your system and defend it against malware that secretly hides within downloaded or shared files. Always download files from trusted sources and be wary of file extensions ending in (.exe), (.bat), (.js), and even (.zip) file formats, among others.

We recommend implementing antivirus (AV) protection with a virtual private network (VPN), as this duo significantly enhances file security. AV software scans downloads for malware and removes or quarantines them before they can do harm, provides real-time threat detection, and safeguards your privacy while a VPN encrypts your internet connection. This ensures safe file transfers and protects your data from unauthorized access, helping you stay safe online.

To combat malware, use the best antivirus software for scanning downloaded files and system protection. We curated our list of the best AV protection software with a VPN for secure file sharing, starting with TotalAV as our best overall pick and our strong runner-ups, McAfee and Bitdefender.

The best antivirus software for secure file sharing

  • TotalAV: Offers robust features for safely downloading, sharing, and storing files, including real-time antivirus protection and a secure VPN for online privacy.

    Get TotalAV | Read TotalAV Review
  • McAfee: Provides comprehensive security solutions that include malware protection, encrypted storage, and a VPN to keep your files safe across all devices.

    Get McAfee | Read McAfee Review
  • Bitdefender: Delivers top-tier security with advanced malware detection, secure file encryption, and a VPN for complete online anonymity and safety.

    Get Bitdefender | Read Bitdefender Review

FAQs


+

Is compress and extract the same?

No, they’re opposite. Compressing a file reduces its size. Extracting a file restores its size.


+

How do I compress or extract files?

There are various ways to compress or extract files, depending on your operating system. Refer to our guide at the beginning of this article to learn how to compress or extract files on a Windows, macOS, Linux, iOS, or Android device.


+

How do I extract highly compressed files?

Use a compression program like 7-Zip or WinRAR. These tools support diverse file formats and allow easy extraction.


+

How do I extract all compressed files?

Select all files, right-click, and choose Extract All or an equivalent option.

Bottom line

Knowing how to compress and extract files is very useful when you want to save storage space on your device or send and transfer files around. Compressing a file allows you to reduce its size while extracting a file allows you to revert the file to its original size. The same concept applies when compressing and extracting folders.

Mastering file compression and extraction is your key to smart data management — saving space and streamlining file transfers has never been easier. But don't let your guard down; safeguard your digital journey. Upgrade your security with the best antivirus software with VPNs.

Online Protection With VPN Access and Identity Monitoring
5.0
Editorial Rating
Learn More
On McAfee's website
All-In-One
McAfee
Save $90 on a 2-year plan
  • Inclusive antivirus, scam, and web protection with the added privacy of a VPN, identity monitoring, and secure password manager
  • Get a real-time Protection Score that measures your online safety and offers guidance to improve security
  • Added peace of mind with 24/7 expert online support and McAfee’s Virus Protection Pledge
  • Multiple pop-ups for text notifications can be annoying

Author Details
Mars is a California-based cybersecurity professional and writer currently pursuing a B.S. in Cybersecurity. With interests ranging from OSINT to ethical hacking and threat intelligence, Mars leverages his two years of writing experience to produce informative content on topics such as Internet guides and VPNs.