How to Repack a TAR.GZ Archive Online
- Upload Your TAR.GZ File: Drag and drop or click "+ Add Files" to load one or more
.tar.gzarchives. Batch is supported — drop a folder full of release tarballs in one pass. Files are uploaded over an encrypted connection, processed on our servers, and deleted automatically after a few hours. - Choose Single Archive or Individual Archives: Pick Single Archive to combine every uploaded
.tar.gzinto one merged tarball, or Individual Archives to re-emit each input as its own normalized.tar.gz. Default for multi-file uploads is Individual Archives. - Review the Defaults (Optional): The repacker decompresses each input, then re-tars and re-gzips with consistent settings. There are no extra knobs to twist — the goal is a clean, predictable output that matches what
tar czfwould produce on a fresh system. - Repack and Download: Click "Convert" and grab the rebuilt
.tar.gz. No sign-up, no watermark, no file-count limit.
Why Re-pack a TAR.GZ to TAR.GZ?
Going from .tar.gz to .tar.gz sounds like a no-op, but it's the standard way to normalize a tarball — same format, cleaner internals. A tarball produced months ago on a different machine carries that machine's umask, user/group names, file ordering, and a gzip timestamp; re-packing through a known pipeline strips all of that without you needing a Linux shell, GNU tar, and the right combination of flags. Common reasons to do this:
- Shrink an under-compressed tarball —
tar czfuses gzip's default level 6. Re-packing through a higher-level pipeline (or pigz, or a zopfli-style optimizer) typically reclaims a few percent on text-heavy archives without changing the format. Per Google's Zopfli benchmarks, deflate-compatible re-compression saves around 3–8% overgzip -9. (Zopfli — Wikipedia) - Strip personal metadata before sharing — A
.tar.gzfrom your laptop encodes your username, group, file mtimes, and the gzip-recorded creation timestamp. Re-packing zeroes the owner and group and removes the gzip header timestamp so the archive doesn't leak who you are. - Get a reproducible build artifact — Reproducible-builds.org's canonical recipe (
tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --owner=0 --group=0 --numeric-owner... | gzip -n) produces byte-identical archives across machines. (reproducible-builds.org — Archive metadata) Re-packing applies the same normalization so two checksums of the same source tree match. - Merge several tarballs into one — Pick Single Archive and a directory of release tarballs becomes one consolidated
.tar.gzinstead of ten. Useful for vendoring dependencies or bundling logs. - Fix a
.tgzthat won't open in some tools — Older tarballs with PAX extended headers, sparse files, or non-UTF-8 filenames sometimes confuse Windows extractors. A clean repack flattens those into the most-compatible POSIX-ish layout. - Strip junk paths picked up at archive time — Tarballs that include
./prefixes, leading slashes, or.DS_Store/Thumbs.dbdebris look messy when extracted on a different OS. A repack is the simplest way to clean that without rebuilding from source.
Need a different output? Try TAR.GZ to TAR.XZ for ~15–30% smaller files on text-heavy archives, TAR.GZ to 7Z for LZMA-grade compression with a recovery-friendly format, or TAR.GZ to ZIP when you need Windows Explorer to open it natively. To just see what's inside, use Extract TAR.GZ.
TAR.GZ vs Other tarball compressors
| Property | TAR.GZ (gzip) | TAR.XZ (LZMA2) | TAR.BZ2 (bzip2) |
|---|---|---|---|
| Algorithm | DEFLATE | LZMA2 | Burrows-Wheeler + RLE |
| Typical ratio vs raw tar | ~25–35% smaller | ~40–55% smaller | ~35–45% smaller |
| Compress speed | Fastest | Slowest (often 5–10x gzip) | ~3–5x slower than gzip |
| Decompress speed | Fastest | Moderate | Slowest |
| Memory at decompress | <1 MB | ~65 MB (default preset 6) | ~3–8 MB |
| Native on Linux/macOS | Yes (since 1990s) | Yes (GNU tar ≥1.22) | Yes |
| Native on Windows | No — needs 7-Zip / WinRAR | No — needs 7-Zip | No — needs 7-Zip |
| Multi-threaded tool | pigz |
xz -T0, pixz |
lbzip2, pbzip2 |
| Best fit | Streaming, log rotation, fast CI tarballs | One-time distribution downloads | Legacy archives; mostly superseded by xz |
Gzip stays popular because decompression is essentially free — the trade-off is compression ratio, which xz beats on almost any text payload. (rootusers.com — Gzip vs Bzip2 vs XZ)
gzip compression levels — what changes between -1 and -9
| Flag | Speed | Typical ratio vs -6 |
Use case |
|---|---|---|---|
gzip -1 (--fast) |
Fastest (~3x level 6) | ~10% larger | Log rotation, real-time pipes, ZFS/HTTP compression |
gzip -6 (default) |
Baseline | Baseline | Default tar czf, most distros' package tarballs |
gzip -9 (--best) |
~2–3x slower than -6 |
~1–3% smaller | Source releases, archives downloaded many times |
pigz -9 |
Same ratio as gzip -9, parallel | Same as gzip -9 |
Multi-core CI/CD; drop-in for gzip |
| Zopfli | ~80x slower than gzip -9 |
~3–8% smaller than gzip -9, still gzip-compatible |
One-time-compressed static assets served to many users |
The marginal gain past -6 is real but small — a 100 MB source tarball typically drops to ~99 MB at -9, and to ~96 MB through Zopfli. Decompression speed is unchanged regardless of which level you compressed with. (Zopfli — Wikipedia) (Baeldung — gzip and gunzip)
Frequently Asked Questions
Why would I convert a TAR.GZ to a TAR.GZ at all?
Three common reasons: to shrink a tarball that was created at gzip's default level 6 (re-compressing at level 9 or with a deflate-optimizer often saves a few percent), to normalize its internals (zero the ownership, sort the file list, drop the gzip header timestamp), or to merge several .tar.gz files into one combined archive. Same .tar.gz extension on both sides, different bytes inside.
Will the repacked file be smaller than the original?
Usually a little. If the source was created with tar czf (gzip level 6), expect 1–3% savings from a higher-level repack. Zopfli-grade repacks can save up to ~8% on text-heavy payloads but are 80x slower at compress time. If the source was already gzip -9'd or contains incompressible data (JPEGs, MP4s, already-compressed binaries), don't expect much — gzip is at its mathematical limit on those.
Does repacking break tools that opened the old archive?
No. The output is still a standard .tar.gz — a POSIX tar stream wrapped in a single gzip member. Anything that handled the original (GNU tar, BSD tar, 7-Zip, WinRAR, macOS Archive Utility, Python's tarfile, Go's archive/tar) will read the repack identically.
Can I use this to make a reproducible / deterministic tarball?
Yes — the repack pipeline applies the standard reproducible-builds conventions: sort by name, zero owner/group, normalize mtimes, and gzip without recording the build timestamp (gzip -n). If you re-pack the same input twice you'll get byte-identical output, which is exactly what reproducible-builds.org's canonical recipe is designed to produce. (reproducible-builds.org — Archive metadata)
What's the difference between repacking and just renaming .tgz to .tar.gz?
.tgz and .tar.gz are the same format with different extensions — renaming changes only how Windows/macOS choose an extractor. Repacking actually decompresses and recompresses the bytes, applying whatever normalization the tool does. Use rename if all you want is the extension; use repack to clean the contents.
How does this compare to gzip -d file.tar.gz && gzip -9 file.tar?
That command-line approach only re-runs gzip, which is one of two things this tool does. The tool also rebuilds the inner tar stream — sorting entries, neutralizing ownership, and stripping volatile PAX headers (atime, ctime). If you only need higher gzip compression and don't care about tar internals, gzip -d... && gzip -9... (or pigz -9) is equivalent and faster on the CLI.
Are there cases where I should pick a different output format instead?
Yes. If the receiver runs Windows and isn't installing 7-Zip, convert to TAR.GZ to ZIP — Windows 10/11 opens ZIP natively. If you want the smallest possible file and the receiver has any modern tar, convert to TAR.GZ to TAR.XZ — xz typically lands 15–30% smaller than gzip on text. If you need recovery records, password protection, or per-file random access, convert to TAR.GZ to 7Z.
Will repacking change the file paths inside the archive?
No — the directory tree and filenames inside are preserved. What may change is the order of entries (sorted by name for reproducibility), trailing ./ prefixes (normalized), and obviously-noise files like .DS_Store if the tool is set to drop them. Extracting the repack gives you the same files in the same relative locations as extracting the original.
Is anything uploaded to your servers?
Files are processed by xconvert's edge servers and deleted automatically after a few hours. No account is required and there are no watermarks, file-count limits, or hidden Pro tiers gating the repacker.