Skip to main content
🇪🇸 Español 🇧🇷 Português 🇩🇪 Deutsch
Image Converter Video Converter Audio Converter Document Converter
Tools Guides Formats Pricing API
Log In
Guide

TAR/GZ Archive Format: The Unix Compression Standard Explained

PC By Pablo Cirre

Related conversions

Put what you just learned into practice — convert your files now in seconds, free and without registration.

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.

.tar is the raw archive com no compressão — just arquivos bundled together. .tar.gz (also .tgz) compresses the TAR com gzip: fast, universally suportado, ~65% of original size. .tar.bz2 uses bzip2: slower to create mas slightly smaller (~30-35%). .tar.xz uses the LZMA2 algorithm (same as 7-Zip): slowest to create, smallest size (~25%), fastest to extract — preferred para software distribution. .tar.zst (Zstandard) is the moderno choice: near-bzip2 compressão ratio at near-gzip speed.

.tar is the raw archive mit no Komprimierung — just Dateien bundled together. .tar.gz (also .tgz) compresses the TAR mit gzip: fast, universellly unterstützt, ~65% von original size. .tar.bz2 uses bzip2: slower to create aber slightly smaller (~30-35%). .tar.xz uses the LZMA2 algorithm (same as 7-Zip): slowest to create, smallest size (~25%), fastest to extract — preferred für Software distribution. .tar.zst (Zstandard) is the modern choice: near-bzip2 Komprimierung ratio at near-gzip speed.

.tar is the raw archive con no compresión — just archivos bundled together. .tar.gz (also .tgz) compresses the TAR con gzip: fast, universally soportado, ~65% de original size. .tar.bz2 uses bzip2: slower to create pero slightly smaller (~30-35%). .tar.xz uses the LZMA2 algorithm (same as 7-Zip): slowest to create, smallest size (~25%), fastest to extract — preferred para software distribution. .tar.zst (Zstandard) is the moderno choice: near-bzip2 compresión 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.

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 inclui any directory prefix — if the archive was created com tar -cz mydir/, arquivos will be listed as mydir/filename, so extract with: tar -xzf archive.tar.gz mydir/filename.txt.

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 beinhaltet any directory prefix — if the archive was created mit tar -cz mydir/, Dateien will be listed as mydir/filename, so extract with: tar -xzf archive.tar.gz mydir/filename.txt.

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 incluye any directory prefix — if the archive was created con tar -cz mydir/, archivos 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.

TAR was designed specifically para Unix systems where arquivo permissions, ownership, e special tipo de arquivos (symlinks, device files, FIFOs) are fundamental. Its 512-byte header explicitly stores Unix mode bits, UID, GID, e tipo de arquivo flags. ZIP was designed para cross-platform usar (DOS origin) com no concept of Unix permissions. Most ZIP implementations add Unix permissions as extra fields, mas these are not padrãoized e may be ignored by Windows ferramentas. para Unix system backups, TAR com -p (preserve permissions) is the correct choice.

TAR was designed specifically für Unix systems where Datei permissions, ownership, und special Dateityps (symlinks, device files, FIFOs) are fundamental. Its 512-byte header explicitly stores Unix mode bits, UID, GID, und Dateityp flags. ZIP was designed für cross-platform verwenden (DOS origin) mit no concept von Unix permissions. Most ZIP implementations add Unix permissions as extra fields, aber these are not Standardized und may be ignored by Windows Werkzeuge. für Unix system backups, TAR mit -p (preserve permissions) is the correct choice.

TAR was designed specifically para Unix systems where archivo permissions, ownership, y special tipo de archivos (symlinks, device files, FIFOs) are fundamental. Its 512-byte header explicitly stores Unix mode bits, UID, GID, y tipo de archivo flags. ZIP was designed para cross-platform usar (DOS origin) con no concept de Unix permissions. Most ZIP implementations add Unix permissions as extra fields, pero these are not estándarized y may be ignored by Windows herramientas. para Unix system backups, TAR con -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).

Modern GNU tar (1.31+) inclui native Zstandard support via --zstd: tar --zstd -cf archive.tar.zst directory/. On systems com older tar, pipe manually: tar -cf - directory/ | zstd -o archive.tar.zst. To extract: tar --zstd -xf archive.tar.zst ou tar -xf archive.tar.zst (auto-detection). Set compressão level com ZSTD_CLEVEL env variable or: tar -cf - directory/ | zstd -19 -o archive.tar.zst (level 19 = máximo compressão).

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

Modern GNU tar (1.31+) incluye native Zstandard support via --zstd: tar --zstd -cf archive.tar.zst directory/. On systems con older tar, pipe manually: tar -cf - directory/ | zstd -o archive.tar.zst. To extract: tar --zstd -xf archive.tar.zst o tar -xf archive.tar.zst (auto-detection). Set compresión level con ZSTD_CLEVEL env variable or: tar -cf - directory/ | zstd -19 -o archive.tar.zst (level 19 = máximo compresión).

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.

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