Convert Z to TAR.BZ2 Online (Swapping 1984 LZW for 1996 Burrows-Wheeler bzip2)
Two Unix compression tools from different decades, LZW dictionary coding and bzip2's block-sorting transform, compared directly on the same tarball.
- Add a file Choose or drop it here
- Pick the format Change it whenever needed
- Download the result After conversion completes
Two Unix Compression Tools Born Twelve Years Apart
A .tar.Z file and a .tar.bz2 file typically hold the same kind of content, packaged by TAR the same way, differing only in which compression algorithm was layered on afterward. The .Z half comes from the Unix compress command, implemented by Spencer Thomas in 1984 and finalized as version 4.0 in 1985 using LZW coding. The .bz2 half comes from bzip2, written by Julian Seward and first released in 1996, more than a decade later, built around a completely different compression approach called the Burrows-Wheeler transform.
Converting .tar.Z to .tar.bz2 means decompressing the older LZW layer to recover the plain tarball, then recompressing that same tarball with bzip2 instead. The files, folder structure, and Unix permissions inside pass through both steps completely unchanged; only the algorithm compressing the bytes on disk is different.
Bzip2's name itself gives away its lineage: it's the successor to an earlier tool called bzip, which Julian Seward also wrote, using a similar block-sorting approach but with a less refined implementation. The "2" simply marks the improved, more widely adopted second generation, in the same way LZMA2 marks an improved second generation of the original LZMA algorithm — a naming pattern that shows up repeatedly across compression tool history whenever an author revisits and refines an earlier design rather than starting over from scratch.
Dictionary Substitution Against Block-Sorted Run Compression
Compress's LZW algorithm scans forward through the data, building a dictionary of repeated byte sequences and replacing them with progressively wider codes, from 9 bits up to a configurable maximum, typically 16 bits. Bzip2 takes an entirely different route: it divides input into blocks of up to 900 KB, applies the Burrows-Wheeler transform to rearrange each block's bytes into far more repetitive runs than the original ordering had, then compresses those runs with a move-to-front transform followed by Huffman coding.
Because bzip2's block-sorting approach is generally more effective at exposing repetition for compression than LZW's simpler dictionary substitution, bzip2 tends to compress tighter than compress on most typical files, even though bzip2 itself has since been outpaced by newer algorithms like LZMA2. This is a real, structural difference in approach, not a stylistic variation on the same underlying idea, and it's the specific, technical reason a .tar.bz2 file built from the same source data as a .tar.Z file is generally the smaller of the two.
Compression speed also differs in a way worth planning around: bzip2's block-based approach, working on chunks of up to 900 KB at a time, generally runs slower than LZW's simpler single-pass dictionary substitution, meaning the compression step in this specific conversion typically takes longer than the decompression step that preceded it. For a one-off file conversion this rarely matters, but for a script processing many archives in sequence, it's a real, measurable time cost worth accounting for.
The entropy-coding stage at the end of each algorithm's pipeline also differs in a way that compounds this gap. LZW's output, after dictionary substitution, generally isn't run through a further entropy-coding pass in compress's classic implementation, while bzip2 follows its Burrows-Wheeler and move-to-front stages with genuine Huffman coding, squeezing additional redundancy out of the transformed data that LZW's simpler pipeline leaves on the table.
What a Decade of Algorithm Development Actually Buys You
- Gain — meaningfully better compression on most files: bzip2's Burrows-Wheeler transform generally outperforms LZW's simpler dictionary substitution on typical text and program data.
- Lose — the very lightest possible memory footprint: compress's bounded 16-bit-code dictionary uses less memory than bzip2's block processing, though both remain modest by any current standard.
- Gain — a format still actively supported in current build tooling: bzip2 remains a standard, recognized option in most current package managers and archive utilities, unlike compress, which is largely legacy-only at this point.
- Unchanged — every file, folder, and Unix permission bit inside: TAR's own archive structure passes through both compression algorithms untouched, since neither one is aware of what it's compressing.
- Lose — the compress-specific magic-number safety check: bzip2 uses its own distinct magic number and internal CRC32 checks rather than compress's original header design.
Why Bzip2 Displaced Compress Long Before LZMA2 Existed
Bzip2's 1996 release came in the same general period gzip was already displacing compress as the Unix default, and both newer tools shared a key advantage over compress that had nothing to do with the Unisys LZW patent dispute directly: better compression ratios on typical files, full stop. Gzip won out as the more common default specifically because DEFLATE was fast and patent-free from release, while bzip2 carved out its own niche as the choice for people who wanted a noticeably better compression ratio than gzip and were willing to accept slower compression and decompression speed in exchange.
Compress, meanwhile, never had a comparable moment of being anyone's deliberate best-ratio choice once gzip and bzip2 both existed — its LZW algorithm was already the oldest and least competitive of the three by the mid-1990s, and the growing patent-enforcement risk around LZW, following Unisys's 1994 GIF royalty announcement, gave Unix tooling an additional, concrete reason to move away from it that had nothing to do with compression ratio at all.
This combination of factors is why compress's decline wasn't a single event but a slow squeeze from two directions at once: gzip took over as the fast, patent-free everyday default, and bzip2 took the niche of "I want better compression and don't mind waiting a bit longer," leaving compress with essentially no remaining use case that either newer tool didn't already cover better, years before the patent situation was even fully resolved in 2003.
The Real Complaint Behind "This Old Archive Won't Decompress on My New System"
A specific, documented issue reported when working with genuinely old .tar.Z archives on modern minimal or containerized Linux environments is a missing compress-compatible decompressor, since some slimmed-down container base images ship only gzip and bzip2 support by default, treating compress as optional legacy tooling not worth including. The fix reported across sysadmin forums is explicitly installing ncompress or a similar package rather than assuming compress support ships everywhere gzip and bzip2 do, since the assumption that "if my system can decompress .gz, it can decompress .Z too" doesn't actually hold on every current system.
A second, unrelated issue shows up specifically with very large files being recompressed into bzip2: because bzip2 processes data in blocks capped at 900 KB, it can't exploit repetition across a wider span the way a larger-dictionary algorithm can, so recompressing something like a large database dump from .tar.Z to .tar.bz2 sometimes produces a smaller improvement over the original LZW-compressed size than expected. This isn't a malfunction — it's the direct, structural consequence of bzip2's bounded block size, and choosing XZ instead for that specific kind of large, highly repetitive file generally closes that gap.
A third pattern shows up specifically in build environments still running scripts written when compress was the only widely available Unix compression tool, decades before either gzip or bzip2 existed. These scripts sometimes hardcode a call to the compress binary by name rather than checking for whatever compression tool is actually available, and when compress isn't installed on a modern minimal system, the script fails outright instead of falling back to gzip or bzip2. Updating the script to check for an available compressor rather than assuming compress specifically is present is the documented long-term fix, distinct from simply installing compress as a one-time patch.
1984 Dictionary Coding Set Beside 1996 Block-Sorting Compression
| Feature | TAR.Z | TAR.BZ2 |
|---|---|---|
| Algorithm | LZW, adaptive 9-16 bit codes | Burrows-Wheeler transform + Huffman |
| Author / release year | Spencer Thomas, 1984 | Julian Seward, 1996 |
| Block/dictionary limit | 16-bit code ceiling | 900 KB per block |
| Typical relative compression ratio | Lower | Higher on most data |
| Current tooling support | Legacy, decompression-focused | Still actively supported by default |
| Patent history | Patented until 2003, now expired | Never patent-encumbered |
Questions About Upgrading an Old LZW Archive to Bzip2
Will my file get noticeably smaller switching from .Z to .bz2?
Usually yes. Bzip2's Burrows-Wheeler transform generally compresses tighter than LZW's older dictionary substitution approach on most typical files.
Why did compress lose out to both gzip and bzip2?
Both newer tools compressed better than LZW on typical data, and gzip additionally avoided the Unisys LZW patent dispute entirely by using the patent-free DEFLATE algorithm, giving the Unix world two independent reasons to move away from compress.
Does this conversion change any of the files inside the archive?
No. TAR's file list, folder paths, and Unix permission bits carry through unchanged; only the compression algorithm applied to that structure is different.
My old system can't open my .Z file anymore. Why?
Some modern, minimal Linux environments only include gzip and bzip2 support by default, treating compress as optional legacy software. Installing a package like ncompress typically resolves it.
Is bzip2 itself becoming outdated the way compress did?
Not in the same sense. Bzip2 remains actively supported across current operating systems and package managers, though newer algorithms like LZMA2 in XZ generally outperform it on compression ratio for large, highly repetitive files.