Convert Any File to TAR.7Z Online (Tar Plus LZMA2 Compression)

What happens to different kinds of source files once they get wrapped in a tar container first and then compressed with 7-Zip's LZMA2 algorithm.

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

Packing Any File Type Into a Tar-Then-7-Zip Archive

Building a TAR.7Z file from any source, whether a single document or an entire folder of mixed content, always happens in a fixed order. First, tar wraps the input into one continuous stream, writing a 512-byte header for each file that records its name, size, Unix permissions, ownership, and modification time ahead of the file's raw bytes. Second, 7-Zip compresses that entire tar stream using LZMA2, the dictionary-based algorithm behind its .7z format since Igor Pavlov released it in 1999, working across a dictionary that can scale into the gigabytes rather than DEFLATE's fixed 32 KB window.

This two-step order matters specifically because 7-Zip's own native container can already hold multiple files directly, without tar's help — meaning building a .tar.7z is a deliberate choice, made specifically because the source files carry Unix-specific metadata (ownership, permission bits, symlinks) that the plain .7z format has no standard field to store on its own.

That distinction holds regardless of what the source files actually are. A single spreadsheet, a folder of source code, or an entire directory tree pulled from a Linux server all go through the exact same two stages in the exact same order — tar records each item's metadata and bundles the content into one stream, and only then does 7-Zip's LZMA2 engine get applied to shrink the result.


What Determines How Much a Given Source File Actually Shrinks Under LZMA2

LZMA2's compression depends on finding repeated byte patterns across its dictionary window, so how much a specific source file shrinks depends heavily on how repetitive that file's data actually is. Plain text, source code, structured data formats like JSON or CSV, and uncompressed disk or database images tend to compress substantially, since LZMA2's large dictionary can find and exploit repetition across a much wider span of the file than gzip's DEFLATE or bzip2's 900 KB blocks ever could.

Photos, video, and audio already compressed with their own lossy algorithms — JPEG, MP4, MP3, and similar formats — behave completely differently, since that data is close to random-looking at the byte level by design, leaving LZMA2's pattern-matching little genuine repetition to exploit. Bundling several already-compressed files together into a single TAR.7Z still has real organizational value, combining scattered files into one container and preserving each one's original ownership and permissions, but it shouldn't be expected to meaningfully shrink their combined size.

Mixed folders containing source code alongside virtual machine images, executables, or office documents built on older binary formats fall in between: they combine genuinely repetitive structure with binary data that resists compression less predictably, so LZMA2's advantage over simpler compressors narrows compared to a folder of pure text, though it typically still outperforms gzip on the same mixed content given its larger reference window.


What Bundling Different Source Types Into TAR.7Z Gains and Costs

  • Gain — full Unix metadata preservation regardless of source type: tar's header captures permissions, ownership, and symlink targets before 7-Zip ever compresses the data, something a plain .7z archive of the same files wouldn't retain by default.
  • Gain — strong shrinkage on text-based and structured sources: source code, logs, and configuration files typically compress substantially under LZMA2's wide dictionary.
  • Gain — genuine multithreaded compression on large batches: 7-Zip applies full multithreading to LZMA2 specifically, letting large mixed-source archives compress faster on multi-core hardware than the older, less parallel LZMA method allows.
  • Lose — negligible savings on already-compressed media: photos, video, and audio see little size reduction, since their data is already close to random at the byte level.
  • Lose — a two-step extraction process: recovering the original files means removing 7-Zip's compression layer first, then unpacking tar's own header structure underneath, rather than reaching the content in one pass.
  • Lose — the ability to easily update a single file in place: since the whole tar stream is compressed as one continuous unit, adding or replacing one file inside an existing TAR.7Z generally means rebuilding the entire archive.

Which Systems Actually Build TAR.7Z Output by Default

Neither Linux, macOS, nor Windows builds a .tar.7z file through a single default command the way GNU tar's -j or -z flags handle bzip2 or gzip directly, since tar itself has no built-in LZMA2 mode. On Linux and macOS, the standard documented approach pipes tar's output directly into 7-Zip's command-line archiver (p7zip on these platforms) without writing an intermediate file, for example tar cf - directory | 7za a -si directory.tar.7z, producing the full combination in one pass.

On Windows, 7-Zip's graphical interface can compress an existing .tar file into .7z directly, but building the combination from an arbitrary folder of mixed source files still means creating the tar archive first (via tar.exe, which has shipped since Windows 10 Insider Build 17063 in 2018) and then compressing that intermediate file with 7-Zip as a second, separate step, since 7-Zip's own archive-creation dialog doesn't offer a single combined "tar.7z" option from a raw folder.

This two-step presentation across every platform is a direct reflection of what's actually happening underneath: there's no single "tar.7z compressor," only a tar-bundling step and an LZMA2-compression step run one after another, regardless of which source file types are being combined.

PeaZip offers a comparable path on both Windows and Linux, letting a user select a folder, choose tar as the intermediate container, and apply 7z-style LZMA2 compression as a second configured step within the same interface, without needing a separate command-line pipe — a more approachable route to the same underlying two-stage result for anyone who prefers not to use the terminal.


Real Complaints About Building TAR.7Z Archives From Mixed Sources

A frequent complaint on backup and sysadmin forums involves bundling a folder that mixes source code with virtual machine images or media files into a single TAR.7Z, expecting the combined archive to shrink close to what the text portion alone would achieve, then being surprised the overall reduction is much smaller — the media and binary content dominates the total size and compresses far less efficiently, regardless of how well the text-based files did individually.

A second documented issue involves someone archiving a Linux directory straight into a plain .7z rather than tar-then-7z, then discovering after extraction that file ownership, permissions, and symlinks weren't preserved as expected — a direct consequence of 7z's own container lacking standard fields for that Unix-specific metadata, and the exact reason the tar-first approach exists as a documented workaround in the first place.

A third recurring pattern involves LZMA2 compression on a very large batch of mixed files taking noticeably longer than expected on older or single-threaded hardware, since while 7-Zip does apply full multithreading to LZMA2, the actual speed gain still depends on how many CPU cores are genuinely available to split the work across.


Building a TAR.7Z From Common Source Types

Source content Typical size reduction Why
Plain text / source code High LZMA2's wide dictionary finds repetition easily
CSV / JSON / config files High Structured, repeating patterns
Virtual machine / disk images Moderate to high Mix of repetitive and binary structure
JPEG / MP3 / MP4 Minimal, near 0% Already compressed; near-random byte data
Mixed folder (text + media) Depends on media share Media files dominate total size
Unix ownership/permissions Fully preserved Captured in tar's header before compression

Common Questions About Converting Files Into a TAR.7Z Archive

Why go through tar first when 7-Zip can already bundle multiple files itself?
Because the plain .7z format doesn't store Unix permissions, ownership, or symlinks by default, while tar's own header does. Tar-then-7z keeps that metadata intact while still applying LZMA2's strong compression.

Will converting my photos and videos to TAR.7Z make them noticeably smaller?
Not much. JPEG, MP4, and MP3 files are already compressed with their own lossy algorithms, leaving little repetitive structure for LZMA2 to exploit.

Is there a single command that builds a TAR.7Z on Linux or macOS?
The standard approach pipes tar's output directly into a 7-Zip build like p7zip without writing an intermediate file, for example combining tar's archive creation with 7za's compression in one pass through a pipe.

Does 7-Zip use multiple CPU cores when compressing a large TAR.7Z?
Yes, for the LZMA2 method specifically. 7-Zip applies full multithreading to LZMA2, unlike the older LZMA method, which is limited to two threads regardless of available cores.

Can I add one more file to an existing TAR.7Z without rebuilding the whole archive?
Generally no. Since the entire tar stream is compressed as one continuous unit under LZMA2, most tools need to unpack and rebuild the whole archive to add or replace even a single file.

Does the type of source file affect whether Unix metadata gets preserved?
No. Tar records permissions, ownership, and symlink targets in its header the same way regardless of whether the underlying content is a text file, an image, or a binary executable, since that metadata capture happens before compression is ever applied.