What is .gz?

.gz (Gzip) is a compressed file format based on the DEFLATE algorithm. It compresses a single stream of data, often a TAR archive or text file, to reduce size for storage and transfer. Gzip is heavily used in Unix environments and on the web for HTTP content encoding.

This quick guide explains when to use .gz files, how to open them on any device, and how to share them instantly with FileXhost.

When to use .gz files

  • You are compressing TAR archives (creating .tar.gz or .tgz files) for Unix-style distribution.
  • You want efficient compression for text-heavy data like logs, JSON, or CSV files.
  • You are configuring web servers to serve compressed responses using gzip or compatible algorithms.
  • You need a simple, stream-friendly compression format with broad tooling support.

How to open .gz files

On Linux and macOS, use the 'gunzip' or 'gzip -d' commands, or tools like 'tar -xzvf file.tar.gz' for tarballs. On Windows, 7-Zip, WinRAR, PeaZip, and similar archivers can open .gz files. Many GUI archive tools on all platforms handle .gz transparently, especially when combined with TAR. Browsers will download .gz files directly unless used as HTTP compression, in which case they transparently decompress responses.

Algorithm details

Gzip wraps the DEFLATE algorithm in a simple header and footer format. DEFLATE combines LZ77-style sliding window compression with Huffman coding to replace repeated patterns and common byte sequences with shorter codes. The Gzip header stores metadata such as original filename and timestamps, while the footer includes a CRC32 checksum and the original size for integrity checking.

Browser & platform support

  • Desktop: Browsers do not open standalone .gz files directly, but they widely support gzip as an HTTP content-encoding for HTML, CSS, JavaScript, and JSON responses.
  • Mobile: Mobile browsers and apps support gzip HTTP compression transparently; standalone .gz files must be opened with archive apps.
  • OS: Native CLI support is built into Unix-like systems; Windows relies on additional tools or recent PowerShell commands for gzip operations.

Format comparison

FeatureDetails
CompressionGenerally better compression than classic ZIP for text data, but often beaten by newer formats like xz or 7z in maximum-compression scenarios.
Use CaseOptimized for streaming and piping data (logs, backups, web responses) rather than multi-file archiving.
Container ModelCompresses a single data stream; multi-file archives typically use TAR first, then apply gzip (resulting in .tar.gz).
CompatibilityExcellent in Unix and web ecosystems; less familiar than ZIP to non-technical users on desktop.

How to create gz files

  • CLI: 'gzip file.txt' or 'tar -czf archive.tar.gz directory/' on Unix-like systems.
  • GUI Archivers: 7-Zip, Keka, PeaZip, and others can create .gz and .tar.gz archives.
  • Build/CI Pipelines: Many packaging workflows produce .tar.gz artifacts for releases or container images.
  • Web Servers: Nginx, Apache, and CDNs can gzip assets on the fly for HTTP delivery.

How to convert gz files

  • FileXhost: Upload .gz or .tar.gz files to distribute compressed archives as single download links.
  • Desktop: Use 7-Zip, WinRAR, or PeaZip to decompress .gz files and optionally repack into ZIP or 7z.
  • CLI: Combine 'gunzip' with other tools (tar, zip, 7z) to convert between compressed formats.
  • Scripting: Use scripting languages (Python, Node.js, Go) with built-in gzip libraries for automated compression and decompression.

Advantages & disadvantages

Advantages

  • Simple, stream-friendly format ideal for command-line and server workflows
  • Very effective on text and log data
  • Native tooling in Unix-like environments and broad support in web infrastructure
  • Widely interoperable with scripting languages and DevOps pipelines

Disadvantages

  • Handles only a single data stream; needs TAR or similar for multi-file archives
  • Not as space-efficient as xz or modern high-compression formats in some cases
  • Less intuitive than ZIP for non-technical desktop users

Tools & software

CLI

gzip, gunzip, tar, pigz (parallel gzip)

Archivers

7-Zip, WinRAR, PeaZip, Keka, The Unarchiver

DevOps/Programming

Nginx, Apache, Node.js zlib, Python gzip module, Go compress/gzip

Frequently asked questions

What is the difference between .gz and .tar.gz?

.gz is a compressed single data stream, often a single file. .tar.gz (or .tgz) is a TAR archive of many files that has then been compressed with gzip. To extract a .tar.gz, you typically run a single tar command that handles both steps.

Should I use gzip or ZIP?

For Unix scripting, server backups, and web content, gzip (often combined with TAR) is a natural choice. For sharing archives with non-technical users on desktop systems, ZIP is usually more convenient because it is natively supported by most OSes.

Can I open .gz files on Windows?

Yes. Tools like 7-Zip, WinRAR, and PeaZip can open .gz and .tar.gz files. Recent versions of Windows and PowerShell also include commands for working with gzip-compressed data.

Is gzip still relevant with newer formats like xz or zstd?

Yes. Gzip remains extremely popular because of its speed, simplicity, and universal support, especially in web and Unix ecosystems. Newer formats can provide better compression or speed, but gzip remains a safe default when compatibility matters.

Technical specs

File type
Archive
Extension
.gz
MIME type
application/gzip, application/x-gzip
Compression
Lossless
Max file size on FileXhost
Up to 25 MB per file on the free plan and up to 1 GB on Pro FileXhost accounts.

Share .gz files instantly

Upload your .gz file to FileXhost to get a clean, shareable URL in seconds. View the file in a modern browser, protect access with optional settings, and let others download it without any confusing ads or cluttered file pages.

Upload .gz file