Convert TAR.XZ to TAR.GZ Online (Undoing Two Package-Ecosystem Cutover Dates at Once)

Debian and Fedora both moved specific package formats away from gzip on documented dates — this conversion runs part of that history in reverse.

  1. Add a file Choose or drop it here
  2. Pick the format Change it whenever needed
  3. Download the result After conversion completes

A Conversion That Runs Two Documented Migrations Backward

Converting .tar.xz to .tar.gz reverses, at least for one file, a shift that two major Linux packaging ecosystems each made on a specific, recorded date. Fedora's RPM packaging adopted xz as its default payload compression starting with Fedora 12, replacing gzip specifically because xz's LZMA2 compression produced meaningfully smaller installed packages. Debian's dpkg-deb made the equivalent move years later, switching its own default compressor from gzip directly to xz with the 1.17.0 release, after discussion that began around DebConf 2012. Rebuilding a .tar.xz file as .tar.gz today puts that one file back on the gzip side of both those documented transitions.

Mechanically, this is the same two-step process any tarball recompression follows: the LZMA2 layer gets fully decompressed to recover the plain tar stream, and gzip then compresses that same stream using its DEFLATE algorithm, defined in RFC 1951. Every file, folder path, and Unix permission bit inside tar's own header structure passes through both steps untouched, since neither compression algorithm has any awareness of the tar format it's wrapping.

Because the full ".tar.xz" extension already confirms a tar archive is inside, unlike plain ".xz" files which could just as easily hold a single compressed file, this conversion doesn't require first determining what kind of content is being unwrapped — it's a known, two-step reversal from the start: remove LZMA2, then apply DEFLATE.


Why Those Two Packaging Systems Moved to XZ in the First Place

The technical reason both projects made that switch comes down to LZMA2's dictionary size against DEFLATE's fixed window: DEFLATE, gzip's algorithm, is capped at a 32 KiB sliding window regardless of settings, while xz's preset levels scale the dictionary from 256 KiB at the lowest setting up to 64 MiB at the highest, letting LZMA2 find matching data across a vastly wider span of a large package's contents than gzip's fixed window ever could. For RPM and .deb payloads, which can contain large binaries and libraries, that wider matching window translated into real, measurable reductions in installed package size across an enormous number of downloads.

Kernel.org's own tarball history shows the same pattern playing out on a separate, independently documented timeline: XZ-compressed tarballs were offered alongside the older gzip and bzip2 options for years before the project's main pub download locations stopped generating anything but XZ-compressed tarballs on September 1, 2018, a full decade after xz's stable specification arrived in December 2008. In every one of these cases, gzip wasn't dropped because it stopped working — it was replaced because xz's dictionary-based compression consistently produced smaller files at a scale where that difference mattered.

Reversing that decision for one specific file, as this conversion does, doesn't undo the underlying technical reasoning — it just prioritizes something else instead, most often the need for gzip's much broader baseline decoder support over the smaller file size xz's wider dictionary would otherwise provide.


What Moving Back to Gzip's DEFLATE Actually Changes

  • Lose — LZMA2's wider dictionary matching: DEFLATE's fixed 32 KiB window generally can't find as much repetition as LZMA2's dictionary, which scales up to 64 MiB at xz's highest preset.
  • Gain — DEFLATE's much longer track record as a universal baseline: gzip decoders, since DEFLATE also underlies ZIP and PNG, are built into an enormous range of software far beyond what xz has achieved in its shorter existence.
  • Gain — faster compression at typical settings: gzip's simpler window and Huffman-only entropy coding generally runs faster than xz, especially at xz's higher, slower presets.
  • Unchanged — every file, folder, and Unix permission bit inside: tar's own structure passes through both algorithms untouched, since neither is aware of what it's compressing.
  • Lose — the exact compression ratio Fedora and Debian's own package infrastructure moved to xz specifically to gain: the size increase reversing this conversion produces is the same tradeoff those projects deliberately chose to avoid at scale.
  • Gain — a smaller, simpler decompression memory footprint: gzip's fixed 32 KiB window needs far less memory to decode than xz's dictionary-sized decompression requirement, small as that requirement already is.

Where Gzip Tarballs Are Still the Documented Requirement

Despite both Fedora and Debian's packaging infrastructure moving to xz, plenty of language-specific package registries and source-distribution systems outside core Linux packaging still accept, or specifically require, gzip-compressed tarballs as their safe universal default, precisely because every consumer of those packages, regardless of how old their toolchain is, can be assumed to already have a working gzip decoder — an assumption that doesn't hold nearly as reliably for xz given its newer, still-spreading adoption outside Linux-native environments.

Some continuous-integration and containerized build environments report a second, more practical reason to prefer gzip specifically for this conversion direction: xz's higher preset levels need substantially more memory during compression, up to roughly 674 MiB at the maximum preset 9, than gzip requires at any setting, and memory-constrained CI runners or minimal container images sometimes can't accommodate that difference — converting a release .tar.xz down to .tar.gz for a specific automated pipeline step, while keeping the original .tar.xz as the human-facing release artifact, is a documented pattern used to work around exactly that constraint.

Older embedded systems and minimal container base images are the clearest case where this conversion solves a genuine compatibility gap rather than just trading convenience for file size: some of these deliberately slimmed-down environments include only a gzip decoder by default, specifically to reduce their software footprint, and never gained xz support at all, which means a .tar.xz file simply can't be opened there until it's rebuilt as .tar.gz.


The Real Issue Behind "My CI Pipeline Broke After This Package Format Change"

A documented complaint in build-automation forums involves CI jobs written around RPM or .deb tooling that assumed gzip-compressed payloads, based on how those ecosystems worked before Fedora 12 or dpkg 1.17.0 respectively, breaking once the underlying distribution's packages switched to xz by default — the fix reported across these threads is updating the script to detect the actual compression method used, typically by checking the package's own metadata rather than hardcoding an assumption based on how the tooling used to behave years earlier.

A second, related pattern shows up in the opposite direction: automation converting a modern .tar.xz release specifically to .tar.gz for compatibility with one older, still-necessary tool sometimes gets left running indefinitely long after the tool it was originally built for has been retired or upgraded, quietly adding unnecessary decompression-then-recompression overhead to every pipeline run. Periodically confirming that the original compatibility requirement still exists, rather than assuming a years-old conversion step remains necessary forever, is the documented long-term fix.

A third issue reported specifically around this conversion involves size expectations: teams sometimes budget storage or bandwidth based on the smaller .tar.xz figures they're used to seeing from kernel.org, Fedora, or Debian releases, then get caught off guard by the noticeably larger .tar.gz file this conversion produces for the same content — a real, avoidable planning gap rather than any flaw in the conversion process itself.


Two Packaging-Era Defaults Set Side by Side

Feature TAR.XZ TAR.GZ
Fedora RPM default since Fedora 12 Superseded starting Fedora 12
Debian dpkg-deb default since dpkg 1.17.0 Superseded by that release
Kernel.org main-location status Sole format since Sept. 1, 2018 Dropped from main locations that date
Match window size Up to 64 MiB (preset 9) Fixed 32 KiB
Compressor memory at max setting ~674 MiB (preset 9) Far lower at any level
Baseline decoder availability Narrower, newer format Broader, decades-old baseline

Questions About Rolling a Tarball Back to Gzip

Why would I downgrade a release to gzip after xz became the standard?
Usually for a specific downstream requirement — an older tool, a memory-constrained build environment, or a package registry that still expects gzip specifically — rather than for any general technical improvement.

When did Fedora and Debian each move away from gzip for packages?
Fedora's RPM switched to xz starting with Fedora 12. Debian's dpkg-deb switched with the 1.17.0 release, after discussion that began around DebConf 2012 — both moves away from gzip specifically, on separately documented timelines.

How much bigger will my file get after this conversion?
It depends on the data, but noticeably bigger is typical, since DEFLATE's fixed 32 KiB window generally can't match LZMA2's much wider dictionary on the same content.

Does this conversion touch any of the files inside the archive?
No. Tar's file list, folder structure, and Unix permission bits pass through unchanged; only the compression algorithm wrapping that structure differs.

Is gzip still a safe default for source distributions today?
In many contexts, yes — its decades-long track record means essentially every consumer of a package can already decode it, which is exactly why some registries still prefer it over newer, still-spreading formats like xz.