Create TAR.XZ File

Create a TAR.XZ file online: pack files and folders into an xz (LZMA2) compressed tar archive with excellent compression. Free and private, in your browser.

Files are processed in your browser and never uploaded.

How to create a TAR.XZ file

  1. Add files using Choose files or drag and drop. For a directory, click Add a folder or drop the folder onto the drop zone; its internal structure is preserved.
  2. Type the Archive name. The default archive results in archive.tar.xz.
  3. Click Create TAR.XZ. Your files are packed into tar and the tar stream is compressed with xz.
  4. Click Download to save the archive.

xz compression is performed by libarchive running as WebAssembly in your browser. Your files stay on your device throughout.

What makes xz different

xz is the file format of XZ Utils, which uses LZMA2, a refinement of the LZMA algorithm known from 7-Zip. LZMA2 combines a very large search window with sophisticated modelling of the data, so it finds redundancy that gzip's 32 KB window simply cannot see. The result is that a .tar.xz is frequently the smallest of the common tarball formats.

Two properties make it attractive for distributing software and data:

  • Small downloads. Source releases of large projects, including the Linux kernel on kernel.org, are offered as .tar.xz because every saved megabyte is multiplied by thousands of downloads.
  • Fast decompression. Compressing with xz is slow, but unpacking is quick, noticeably faster than bzip2. The effort is spent once by the sender rather than by every recipient.

Because compression is the slow part, a big folder takes longer here than with TAR.GZ. For a quick one-off transfer to a colleague, gzip may be the better trade; for something you will publish or archive long term, xz usually pays off.

Format details

The tar layer is written as POSIX pax, so long paths and file names in any language are kept exactly, and original modification dates are recorded. Empty folders are not included. The short form of the extension is .txz, which some package systems and download sites use; it is the same format.

The matching commands are tar -cJf archive.tar.xz folder/ to create and tar -xJf archive.tar.xz to extract. Note the capital J, which selects xz (lower-case j means bzip2). macOS and most Linux distributions handle .tar.xz out of the box, and on Windows, 7-Zip or recent Windows 11 File Explorer can open it.

Tips

  • If compatibility matters more than size, build a TAR.GZ instead.
  • Want similar compression with an archive Windows users know? Create 7Z also uses LZMA, though it does not keep file dates.
  • To open a .tar.xz or .txz in the browser, use Extract TAR.
Tip: Mostly photos, videos or ZIP files? They are already compressed, so xz will save very little and only add time. A plain TAR or a ZIP is just as good there.

Frequently asked questions

Is .txz the same as .tar.xz?

Yes. Both are a tar archive compressed with xz. Rename the file if a system requires one particular extension.

Can I make a single .xz file without tar?

Yes, choose XZ (.xz) in the GZIP Compressor. Each file is compressed separately.

Why does it take longer than TAR.GZ?

LZMA2 does much more work per byte to reach a higher ratio, and here it runs as WebAssembly. Totals above about 700 MB are slow, and more than 2 GB is refused.

Copied to clipboard