GZ vs XZ
A detailed comparison of Gzip Compressed and XZ Compressed — file size, quality, compatibility, and which format to choose for your workflow.
Gzip Compressed
Archives & CompressedGzip is a single-file compression format based on the DEFLATE algorithm. It is most commonly paired with TAR to create .tar.gz archives and is the standard compression for web content delivery.
About GZ filesXZ Compressed
Archives & CompressedXZ provides very high compression ratio using LZMA2, common in Linux packages.
About XZ filesStrengths Comparison
GZ Strengths
- Patent-free, royalty-free — that was the whole point in 1992.
- Universally supported on every OS.
- Fast compression and extremely fast decompression.
- Preserves original timestamps and filenames in the header.
- Streamable — can compress/decompress over pipes.
XZ Strengths
- Best-in-class compression ratio among mainstream tools.
- Streaming-capable — can pipe through network.
- Multi-threaded compression available.
- Mature on every Linux distribution.
- Supports integrity checking (CRC32, CRC64, SHA-256).
Limitations
GZ Limitations
- Compresses one file at a time — needs tar for multi-file archives.
- Older algorithm — Zstandard, xz, and brotli all beat it on ratio.
- Single-threaded in the reference implementation (pigz fixes this).
- Not as aggressive as modern codecs on highly redundant data.
XZ Limitations
- Slow compression at high levels — 3-5× slower than gzip.
- Memory-hungry: xz -9 can need 700+ MB to compress.
- 2024 supply-chain backdoor damaged trust in the project.
- Zstandard outperforms xz at similar ratios with less memory.
Technical Specifications
| Specification | GZ | XZ |
|---|---|---|
| MIME type | application/gzip | application/x-xz |
| Extensions | .gz, .tgz (with tar) | .xz, .txz |
| Algorithm | DEFLATE (LZ77 + Huffman coding) | LZMA2 |
| Standard | RFC 1952 (gzip), RFC 1951 (DEFLATE) | The .xz File Format specification 1.1.0 |
| Header | 10 bytes: magic, method, flags, mtime, extra, filename, comment, crc, isize | — |
| Integrity checks | — | None, CRC32, CRC64, SHA-256 |
Typical File Sizes
GZ
- Plain text file 25-40% of original
- HTML page 20-30% of original
- Source code archive 15-30% of original
- Already-compressed file (JPEG, MP4) 99-100% (no gain)
XZ
- Text/source archive 15-25% of original
- Linux kernel (.tar.xz) ~125 MB
- Firefox source code ~600 MB
Ready to convert?
Convert between GZ and XZ online, free, and without installing anything. Encrypted upload, automatic deletion after 2 hours.
Frequently Asked Questions
GZ (Gzip Compressed) is an archive format used to bundle multiple files and folders into a single compressed file. The archive preserves the directory structure and typically reduces total size via compression. GZ sits in the archives & compressed family and has specific strengths around compression ratio, speed, or platform support.
XZ (XZ Compressed) is an archive format used to bundle multiple files and folders into a single compressed file. The archive preserves the directory structure and typically reduces total size via compression. XZ sits in the archives & compressed family and has specific strengths around compression ratio, speed, or platform support.
7-Zip, WinRAR, The Unarchiver (macOS), and the built-in archive utilities on Windows and macOS open most GZ files. For command-line extraction, 7z, unar, or the format-specific tool handles GZ cleanly. If your extractor does not recognise GZ, convert to ZIP first — ZIP opens on every operating system without extra software.
7-Zip, WinRAR, The Unarchiver (macOS), and the built-in archive utilities on Windows and macOS open most XZ files. For command-line extraction, 7z, unar, or the format-specific tool handles XZ cleanly. If your extractor does not recognise XZ, convert to ZIP first — ZIP opens on every operating system without extra software.
Upload the GZ to KaijuConverter and pick ZIP, 7Z, TAR.GZ, or RAR as the target. Our pipeline extracts the original archive and re-compresses the contents into the target format. File permissions, timestamps, and directory structure are preserved where both formats support them.
Depends on the goal. ZIP is the universal baseline — every OS extracts it out of the box. Formats like 7Z or TAR.GZ compress better but require specific tools. GZ may win on compression ratio, password support, or OS integration for specific workflows; ZIP wins on raw compatibility.