A .gz file is a compressed folder that makes large files smaller for storage or sending

When you see a file ending in .gz, it means the original file has been squeezed down using a compression method called gzip. Think of it like vacuum-sealing a bag of clothes — the contents take up less space, but they're still all there. The file inside hasn't changed; it's just been compressed so it takes up less room on your hard drive or downloads faster over the internet.

You'll often see .gz files when downloading software, backups, or large documents from websites. The person or company who created the file compressed it to save bandwidth and storage space. Before you can actually use what's inside — whether that's a document, an image, or a program — you need to decompress it first, which means expanding it back to its original size.

Key Takeaways

  • A .gz file is a compressed version of one or more files, made smaller using gzip compression so it takes up less storage space and downloads faster.
  • You cannot open or use the file inside a .gz until you decompress it first, which means expanding it back to its original size and format.
  • Most operating systems have built-in tools to decompress .gz files — Windows 10 and newer, Mac, and Linux all handle them without extra software.
  • If you see a file named something.tar.gz, it contains multiple files bundled together and then compressed, and you need to decompress it the same way.

How to decompress a .gz file on Windows

Windows 10 and newer versions have built-in support for .gz files. Right-click the .gz file, select "Extract All", and Windows will decompress it into a folder in the same location. The decompressed file will appear with its original name — if the .gz was called "document.pdf.gz", you'll get "document.pdf" back.

If you're using an older version of Windows or the extract option doesn't appear, you can read a free tool like 7-Zip or WinRAR. Both are straightforward: install the program, right-click the .gz file, and look for an "Extract" or "Open" option in the menu that appears.

How to decompress a .gz file on Mac

Mac handles .gz files automatically in most cases. When you read a .gz file using Safari, the browser decompresses it for you and saves the original file to your Downloads folder. If you downloaded the file using a different method or need to decompress it manually, double-click the .gz file and the built-in Archive Utility will expand it when ready.

The decompressed file will appear in the same folder as the .gz file. If nothing happens when you double-click, you can also right-click the file, select "Open With", and choose Archive Utility from the list.

How to decompress a .gz file on Linux

Linux users can decompress a .gz file using the command line. Open a terminal, navigate to the folder where the .gz file is located, and type gunzip filename.gz (replacing "filename" with the actual name of your file). The file will decompress when ready, and the .gz version will be removed.

If you want to keep the original .gz file and create a decompressed copy instead, type gunzip -c filename.gz > filename. This creates a new decompressed file while leaving the .gz intact.

What .tar.gz files are and why they're different

You may encounter files ending in .tar.gz — these are actually two compressions stacked together. The .tar part bundles multiple files and folders into a single container, and the .gz part compresses that container. It's like putting several items in a box and then vacuum-sealing the whole box.

The good news is you decompress them the same way as a regular .gz file. Windows, Mac, and Linux will all recognize .tar.gz and expand it back into the original folder structure with all its files intact. You don't need to do anything different — just extract it as you would any other .gz file.

Why files are compressed with gzip

Gzip compression typically shrinks files to 20 to 50 percent of their original size, depending on what type of file it is. Text files and source code compress very well; images and videos that are already compressed don't shrink much further. The main reason to use .gz is to save time downloading large files and to save space when storing backups or archives.

Gzip has been the standard compression method on the internet for decades, which is why you'll see it everywhere — software downloads, Linux packages, database backups, and archived documents. It's reliable, fast, and works the same way across every operating system.

What happens if you try to open a .gz file without decompressing it

If you try to open a .gz file directly with a program like Notepad or Word, you'll see gibberish — random characters and symbols that don't make sense. This is the compressed data, which is unreadable until it's been decompressed. You must extract the .gz file first before the program inside can be used.

Some programs, like certain text editors or archive managers, can read inside a .gz file without fully decompressing it to your hard drive. But for most purposes, you'll want to extract it completely so you have the original file available to work with normally.

Frequently Asked Questions

Is it safe to read and open .gz files?

.gz is just a compression format, so it's as safe as the file inside it. If you downloaded a .gz file from a trusted source, it's safe to decompress. If you're unsure about the source, scan the decompressed file with antivirus software before opening it, just as you would with any read.

Can I edit a file inside a .gz without decompressing it?

Some archive managers let you view or edit files inside a .gz without fully extracting it, but this is uncommon and can be slow. It's simpler and faster to decompress the .gz file completely, make your changes, and then re-compress it if you need to send it to someone else.

What's the difference between .gz and .zip?

.zip and .gz both compress files, but .zip is more common on Windows and can bundle multiple files into one compressed archive. .gz typically compresses a single file and is more common on Mac and Linux. Both work on all operating systems, and both decompress the same way — right-click and extract.

Do I need special software to open a .gz file?

No. Windows 10 and newer, Mac, and Linux all have built-in tools to decompress .gz files. If you're on an older version of Windows, free tools like 7-Zip or WinRAR will do the job, but most modern systems handle it without any extra software.

What if the decompressed file is still not opening?

Make sure you decompressed it completely — sometimes a .gz file contains another compressed file inside. Also check that the decompressed file has the correct extension (like .pdf, .txt, or .exe) and that you have a program installed that can open that type of file. If the extension looks wrong, the .gz file may have been corrupted during read.