Convert LZMA to TAR.GZ Online (Rebuilding a Legacy Stream Inside the Most Common Compressed Tarball)

The old 13-byte LZMA_Alone header gets decompressed and rebuilt with DEFLATE inside a proper multi-file tar archive — the everyday default most tools already understand, in place of the format almost nothing writes anymore.

  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 Thin Legacy Stream Rebuilt Inside a Gzip-Compressed Tarball

A .lzma file is the older standalone container often called LZMA_Alone: a 13-byte header — one byte for the lc/lp/pb compression parameters, four bytes for dictionary size, eight bytes for uncompressed size — directly followed by LZMA-compressed data, with no magic number and no checksum anywhere in the format. Igor Pavlov, LZMA's creator and the developer of 7-Zip, placed the LZMA SDK in the public domain on December 2, 2008, and the .xz container that replaced this standalone format for general use arrived in 2009, built specifically to fix the gaps this thinner format left open.

Part of why the standalone format fell out of favor is specific and documented: it has no magic number for reliable detection, no checksum of any kind, and an ambiguous way of signaling end-of-stream when the uncompressed size isn't known ahead of time, relying on an embedded marker that different decoder implementations have historically handled inconsistently. Those three gaps, taken together, are exactly what the newer .xz container was designed to close.

TAR.GZ is structurally unrelated: it's a plain tar archive — a sequence of 512-byte header-and-data blocks, each header recording a file's name, permissions, and size — with the whole resulting stream then compressed using gzip's DEFLATE algorithm, defined in RFC 1951. Converting a .lzma file to .tar.gz means decompressing the legacy stream back to its original bytes, wrapping that recovered data inside tar's own block structure, and then compressing the whole thing with DEFLATE, which combines LZ77-style back-reference matching with Huffman coding.


Why LZMA's Range Coding Usually Beats DEFLATE, and What Gets Given Up

LZMA compresses through dictionary-based matching combined with range coding, a form of arithmetic coding capable of assigning fractional-bit-precision codes to symbols based on how frequently they appear, which lets it squeeze out redundancy more finely than DEFLATE's simpler Huffman coding, which assigns whole-bit-length codes only. This is the direct, mechanical reason LZMA-compressed data is generally smaller than the same data compressed with DEFLATE, and why formats built around LZMA — the legacy standalone container, .7z, and later .xz — have consistently benchmarked ahead of gzip on compression ratio across a wide range of file types.

What DEFLATE gives up in ratio, it largely makes back in universality and simplicity. Gzip's format, unlike the legacy .lzma container, opens with a fixed magic number (0x1F 0x8B) and carries a CRC-32 checksum over the entire decompressed stream, computed and verified automatically by essentially every gzip implementation, giving it built-in corruption detection the standalone .lzma format was never designed to have at all.

Licensing is a further, separate difference. The LZMA SDK sits in the public domain, meaning it can be reused or modified without any attribution requirement whatsoever, while zlib, the library behind gzip's DEFLATE implementation, is distributed under its own permissive zlib License, which likewise imposes no copyleft obligation but does carry its own specific attribution and disclaimer terms — both arrangements are effectively unrestrictive in practice, which is part of why DEFLATE support ended up built into so many programming languages' standard libraries without any licensing friction at all.


What Moving From Legacy LZMA to a Gzip Tarball Changes

  • Gain — a built-in CRC-32 checksum: gzip verifies the entire decompressed stream against a checksum stored in its own footer; the legacy .lzma format has no checksum of any kind.
  • Gain — reliable format identification: gzip's fixed 0x1F 0x8B magic number lets any tool confirm the format instantly, unlike the legacy container's complete lack of one.
  • Gain — native multi-file support: tar bundles any number of files and folders into the archive before gzip compresses it; the legacy .lzma format holds exactly one compressed stream.
  • Lose — some compression efficiency: LZMA's range coding generally compresses somewhat more tightly than DEFLATE's Huffman-based approach on the same data.
  • Gain — Unix permissions and ownership metadata: tar's own header blocks record file mode, owner, and group per entry, none of which the legacy 13-byte header tracks.
  • Lose — the smallest possible per-file overhead: tar's 512-byte blocks plus gzip's own header and footer add more fixed bytes than the bare 13-byte legacy header, though this matters only on the very smallest files.
  • Gain — a documented, stable file format Python, Java, and virtually every other language's standard library can read natively: gzip decompression is built into far more programming environments by default than the legacy .lzma format's `FORMAT_ALONE` handling, which only a narrower set of libraries implement at all.

Tools That Bridge This Specific Legacy-to-Everyday Conversion

Decompressing the source .lzma file requires a tool that specifically still supports the older standalone format: XZ Utils via its `--format=lzma` option or `lzma` command alias, 7-Zip's GUI or command-line tool, or Python's `lzma` module using its documented `FORMAT_ALONE` constant. Building the tar.gz side afterward needs nothing unusual at all — GNU tar's `-z` or `--gzip` flag handles both the archiving and compression steps in a single command, and gzip itself ships by default on virtually every Linux distribution and macOS installation.

On Windows, 7-Zip is genuinely the most convenient single tool for the entire conversion, since the same installation that reads the legacy .lzma format can also build a .tar.gz archive directly through its GUI. WinRAR opens .tar.gz archives for extraction as well but, like most mainstream consumer archivers, doesn't document support for the older standalone .lzma format specifically, which is why the decompression half of this conversion still depends on tooling built with that legacy compatibility in mind rather than a general-purpose archive manager.


Real Problems People Hit Converting Old LZMA Files to Gzip Tarballs

A recurring, documented issue traces back to the legacy .lzma format's ambiguous handling of unknown file sizes: when the header's uncompressed-size field is set to the special unknown-size marker (0xFFFFFFFFFFFFFFFF), the decompressor has to watch for an embedded end-of-payload signal instead of reading a fixed byte count, and a tool that mishandles that case can silently produce truncated output that then gets wrapped into a tar.gz archive missing part of the original file, with no error surfaced anywhere in the pipeline to flag it.

A second common complaint involves the legacy format's total lack of a magic number, which causes automated file-type detection in upload pipelines or content-management systems to misclassify or reject a raw .lzma file outright before it ever reaches the conversion step, unlike a .gz file, whose fixed 0x1F 0x8B signature virtually every general-purpose file-type sniffer recognizes without any special-casing.

A third, more procedural pattern involves scripts or Makefiles written years ago around the standalone `lzma` command specifically, before xz-utils existed as today's combined tool — swapping in a modern xz-utils install without verifying its `--format=lzma` compatibility flag behaves exactly like the original legacy binary can produce a file that a later stage in an aging pipeline doesn't parse the way it expects.

A fourth pattern shows up when someone assumes the two formats are close enough that a decompressed .lzma payload can simply be gzip-compressed directly without the tar step in between, producing a plain .gz file instead of a .tar.gz — that distinction matters the moment more than one file needs bundling, since a bare .gz file, like the legacy .lzma format it replaced in this scenario, holds only a single compressed stream and has no concept of multiple archive entries at all.


Legacy LZMA and TAR.GZ Compared Directly

Feature .LZMA (legacy standalone) TAR.GZ (tar + gzip)
Core compression method Dictionary matching plus range coding LZ77 matching plus Huffman coding
Magic number None 0x1F 0x8B
Integrity checking None CRC-32 over the full decompressed stream
Multi-file support No; single stream only Yes, via tar's own bundling
Typical compression ratio Generally tighter Generally looser than LZMA
Everyday tool support Narrow; compatibility mode only Extremely broad, built into most systems
Source code license Public domain (LZMA SDK) Permissive zlib License

Questions About Rebuilding an Old LZMA File as a Gzip Tarball

Will the resulting tar.gz be bigger or smaller than the original .lzma file?
Usually somewhat bigger, since LZMA's range coding generally compresses more tightly than gzip's DEFLATE on the same data, though the tar.gz result is still far smaller than the fully uncompressed original.

Why does gzip open on virtually any system while my old .lzma file doesn't?
Because gzip has a fixed magic number and decades of near-universal tool support built in, while the legacy standalone .lzma format has no magic number at all and was only ever supported by a narrower set of tools even before .xz replaced it in 2009.

Can a single .lzma file become a multi-file tar.gz archive?
Only if other files are added during the tar step; the legacy format itself holds exactly one compressed stream, so the original file becomes a single entry in the new archive unless more content is bundled alongside it.

Does converting to tar.gz add any corruption protection the original file didn't have?
Yes. Gzip computes and checks a CRC-32 over the full decompressed stream automatically, something the legacy .lzma format's 13-byte header has no field for at all.

Is 7-Zip enough to handle this whole conversion by itself?
Largely yes — 7-Zip can decompress the legacy standalone .lzma format directly and build a .tar.gz archive from its GUI or command line, making it the single most convenient tool for both halves of this conversion on Windows.

Should I use plain .gz instead of .tar.gz for a single decompressed file?
Only if there's genuinely one file involved and it will always stay that way; a bare .gz, like the legacy .lzma format, holds one stream with no room for additional entries, while .tar.gz keeps the option open to add more files later without changing formats again.