Skip to main content
🇪🇸 Español 🇧🇷 Português 🇩🇪 Deutsch 🇫🇷 Français 🇯🇵 日本語 🇮🇹 Italiano 🇮🇩 Bahasa Indonesia 🇹🇷 Türkçe 🇰🇷 한국어 🇵🇱 Polski 🇳🇱 Nederlands
Image Converter Document Converter Video Converter Audio Converter
Tools Formats (201) Guides Pricing · ⚡ 4,99 € API
Log In
Guide · tar → gz

TAR/GZ Archive Format: The Unix Compression Standard Explained

✓ ISO/IEC Verified · 6 min · · By Pablo Cirre
Instant In-Browser Tool
Convert TAR → GZ
Convert →
Guide (12) +
Advertisement

Frequently Asked Questions

.tar is the raw archive with no compression — just files bundled together. .tar.gz (also .tgz) compresses the TAR with gzip: fast, universally supported, ~65% of original size. .tar.bz2 uses bzip2: slower to create but slightly smaller (~30-35%). .tar.xz uses the LZMA2 algorithm (same as 7-Zip): slowest to create, smallest size (~25%), fastest to extract — preferred for software distribution. .tar.zst (Zstandard) is the modern choice: near-bzip2 compression ratio at near-gzip speed.

<strong>7z</strong> (LZMA2) typically beats both ZIP and RAR by 10–30% for text-heavy content, but is slower to create. <strong>RAR</strong> compresses slightly better than ZIP and supports recovery records (good for damaged archives) but the format is proprietary. <strong>ZIP</strong> is the universal lingua franca — every OS opens it natively. Use 7z for long-term storage, ZIP for sharing.

Use: tar -xzf archive.tar.gz path/to/specific/file.txt — providing the exact path as it appears inside the archive. First list the archive contents to find the exact path: tar -tzf archive.tar.gz | grep filename. Note the path includes any directory prefix — if the archive was created with tar -cz mydir/, files will be listed as mydir/filename, so extract with: tar -xzf archive.tar.gz mydir/filename.txt.

Yes, when the file contains anything sensitive. Standard ZIP "encryption" (ZipCrypto) is broken and trivially crackable. Use AES-256 (ZIP 2.0+, supported by 7-Zip, WinRAR, modern Windows). Verify the encryption type when creating: many tools default to ZipCrypto for compatibility. Better still, use 7z which uses AES-256 by default.

TAR was designed specifically for Unix systems where file permissions, ownership, and special file types (symlinks, device files, FIFOs) are fundamental. Its 512-byte header explicitly stores Unix mode bits, UID, GID, and file type flags. ZIP was designed for cross-platform use (DOS origin) with no concept of Unix permissions. Most ZIP implementations add Unix permissions as extra fields, but these are not standardized and may be ignored by Windows tools. For Unix system backups, TAR with -p (preserve permissions) is the correct choice.

Original ZIP: 4 GB total + 65,535 files. ZIP64 (transparent extension): up to 16 EB and unlimited files. Modern tools (Windows Explorer, macOS Finder, 7-Zip, Linux unzip) all support ZIP64 automatically when needed. The only catch: very old tools (pre-2007) cannot open ZIP64 archives.

Modern GNU tar (1.31+) includes native Zstandard support via --zstd: tar --zstd -cf archive.tar.zst directory/. On systems with older tar, pipe manually: tar -cf - directory/ | zstd -o archive.tar.zst. To extract: tar --zstd -xf archive.tar.zst or tar -xf archive.tar.zst (auto-detection). Set compression level with ZSTD_CLEVEL env variable or: tar -cf - directory/ | zstd -19 -o archive.tar.zst (level 19 = maximum compression).

Some content does not compress well: already-compressed media (JPG, MP4, MP3), encrypted files, random binary data. Compression algorithms exploit redundancy — these formats already removed it. To shrink them you would need lossy re-encoding, not archiving. Save archives for text, source code, uncompressed media (BMP, WAV, RAW), and document files.

Professional Workstation Solution
Unlimited Batch Jobs Zero Upload Wait Times Direct Disk-to-Disk I/O

Need to Convert Gigabyte Archives or Mass Folders?

KaijuConverter delivers ultra-fast in-memory conversions for everyday tasks. For multi-gigabyte production workloads without browser bandwidth bottlenecks, explore high-throughput desktop suites.

Zero cloud transfer • Native hardware performance
24-Hour Fast Pass (€4.99 one-time) Up to 1 GB · No subscription

One-time payment with zero recurring commitment: convert files up to 1 GB, OCR, PDF/A, and .ZIP batches for 24 hours.

Instant Stripe Checkout →
7-Day Project Pass (€9.99 one-time) 7 Days · 2 GB · Ad-Free

Full 7 days of unlimited conversions, up to 2 GB per file, 100% ad-free with zero subscription.

Instant Stripe Checkout →
Kaiju Cloud Business Annual (€99/yr) Up to 2 GB + B2B Invoice

High-throughput enterprise pipeline for files up to 2,048 MB, 50-file batches, ISO PDF/A, and priority processing.

Instant Stripe Checkout →
ImageMagick CLI / XnConvert Free • Mass Batch

Convert thousands of camera RAW files (CR3, NEF, ARW) to WebP, AVIF, or TIFF in one pass.

Affinity Photo / Adobe Lightroom Photo Pro

GPU-accelerated RAW development with end-to-end 16-bit ICC color profile management.

Advertisement
We use cookies and similar technologies to personalise content and ads, and to analyse traffic. Learn more about cookies.