Convert XZ to TAR

Converting XZ to TAR strips the compression and leaves the archive underneath. An XZ compresses one stream and knows nothing about file names, so a `.tar.xz` is two formats stacked: the TAR carries the names, paths and permissions, and xz makes the result smaller. Removing the xz layer gives you the tarball that tools like `docker load` accept — much larger, and exactly the shape they expect.

  • Where it runs On our server, because a browser cannot run the software this needs.
  • Lossless Nothing is discarded. The TAR holds exactly what the XZ held.
  • File size limit Up to 25 MB per file, free, without an account.
  • Worth knowing The files come out byte for byte. What does not survive is anything the container held about them rather than in them — a password, and on some formats the original permissions and timestamps.

Up to 100 files at once. Mixed formats are fine.

The tools that will take a tarball and nothing else

Removing compression sounds like the wrong direction and there are several places where it is the only direction. `docker load` reads an image from a tarball. A number of appliance, firmware and instrument importers take a `.tar` because the loader was written to walk TAR headers and nothing was added afterwards. Migration utilities that expect a specific export shape do the same. So do some content-addressed and deduplicating stores, which want the uncompressed bytes because a one-line change to one file should not rewrite the whole artefact.

There is a second reader with a different reason: someone who simply wants to look. A tarball can be inspected, diffed, walked by a script and fed to `tar --to-command` without a decompression step in front of every operation. If you are going to touch the archive twenty times in an afternoon, taking the compression off once and putting it back at the end is a reasonable way to work.

Why a .tar.xz has two layers rather than one

XZ arrived in 2009 and compresses a single stream with LZMA2. It has no field for a file name, no notion of a folder, and no way to record where one member ends and another begins — the registry lists the absence of directory structure as a known problem for the format, which is a fair description of a design decision rather than a defect.

TAR, from 1979 and standardised as POSIX.1-2001 ustar, is the exact complement: a 512-byte header in front of every member recording the name, the path, the size, the owner, the group, the mode and the timestamps, and no compression at all. Between them the two do the whole job, and that is why `.tar.xz` looks like a workaround and is in fact the intended arrangement. This conversion removes the outer half and hands you the inner one.

The file gets much bigger, and that is the entire trade

Every other archive conversion on this site has a size argument in it somewhere. This one has the opposite, and it should be planned for rather than discovered. An XZ of source code, logs or documents can expand several times over; the registry gives XZ a dictionary up to 64 MB, which is why it compressed so well in the first place and therefore why the tarball is so much larger.

The practical consequences are all about where the file has to go next. It will no longer fit an attachment limit that the XZ cleared comfortably. It will take proportionally longer to copy over a network. On a laptop with a nearly full disk, extracting a tarball and then feeding it to a tool that extracts it again means holding the contents three times at once. None of that is a reason not to do the conversion; it is a reason to know the number before you start.

The tarball is rebuilt, so upstream checksums stop matching

This is the most important sentence on the page for anyone converting a published release. The conversion does not peel the xz layer off your file — it extracts the archive completely and writes a new TAR from the contents. The files inside are byte for byte identical, because this is a lossless repack. The tarball around them is not the upstream one.

So the SHA-256 in the release notes, the hash in a package recipe, the signature over the tarball: none of them will verify against what you download here. If verification is part of the job, do the decompression locally with `xz -d archive.tar.xz`, which touches only the outer layer and leaves the tarball exactly as its author wrote it. Use this converter when you need a tarball to exist and its exact bytes are not part of a contract — which covers inspection, importing, and most one-off work, and does not cover packaging.

Permissions and timestamps, which a TAR can hold and may not receive

A TAR header has fields for the owner, the group, the permission bits and the modification time, and for a lot of tarballs those are load-bearing: a release with an install script depends on the script arriving executable, and a container image tarball depends on rather more than that. TAR is the format that can carry all of it.

What it receives here is another question, and the registry’s note for this pair is deliberately blunt: the files come out byte for byte, and what the old container recorded about them rather than in them is the part at risk. Because the archive is unpacked to a scratch directory and re-tarred, the modes and times are whatever survived that round trip. If the tarball is going to `docker load` or into anything that runs what it unpacks, check the header fields with `tar tvf` before you rely on them.

An .xz that never held an archive at all

Not every `.xz` is a compressed tarball. A single large file — a database dump, a disk image, a CSV export — is often compressed on its own, and there is no tarball anywhere in it. The converter handles both cases: it decompresses the stream, tries to unwrap an inner TAR, and when that fails keeps the single file it found.

What you get in that case is a TAR containing exactly one member, which is a slightly odd object but a perfectly valid one and usually still what the tool downstream wants. It is also a useful diagnostic: if you expected a directory of files and the result holds one, the original was never an archive, and whatever told you it was has been misinforming you. XZ stores no file name of its own, so there was nothing in the file to tell you otherwise.

The memory an XZ needs to come apart at all

Decompressing an xz stream requires a buffer scaled to the dictionary the file was written with — up to 64 MB by the registry’s figure. On the machine converting the file that is unremarkable, which is why this rarely comes up. It comes up on the far end: if the reason you are removing the compression is that some small device could not open the XZ, then this conversion is a legitimate way to hand it something it can read, at the cost of a much larger transfer.

That is a different route from recompressing to gzip or bzip2, and it is the right one when the device has plenty of storage and no compressor at all — a rescue environment, a stripped container, an importer that reads TAR headers directly and never shells out to anything. Where the device does have gzip, sending a gzipped tarball is almost always better than sending a bare one.

Where the xz archive is decompressed and what is kept

On our server, not in your browser. Most tools on this site keep the file on your device and say so; archives are one of the exceptions, because the work needs 7-Zip and xz as real programs. The file travels over an encrypted connection to a container that runs them and that has no outbound internet access of its own.

Each job gets a scratch directory on a memory-backed filesystem, deleted as soon as the job ends regardless of outcome, and killed at sixty seconds. Before anything is written the archive is asked what it claims to expand to, and a declared total above 2 GB is refused — a check that matters more here than almost anywhere, because the output of this conversion is the uncompressed size by definition. The free tier accepts 25 MB per uploaded file.

Reading the tarball before you hand it to the next tool

`tar tvf archive.tar` lists every member with its mode, owner, size and timestamp, and it costs nothing. Two things are worth looking at. The first is the top level: an archive packed from inside a directory and one packed from its parent differ by a leading folder on every path, and an importer that expected one and got the other fails with an error about a missing file rather than about a directory.

The second is the permission column, particularly if anything in the archive is meant to be executed. A TAR is one of the few formats that can carry a mode bit, so if it arrives wrong you can fix it — extract, `chmod`, re-tar — rather than discovering it on a machine you do not control. Once the listing looks right, the tarball is ready for whatever refused to take the compressed version.

How to get the TAR out of an xz archive

  1. Drop the XZ or .tar.xz file onto this page, or click to choose one.
  2. The xz layer is removed and the contents are written back out as a plain TAR.
  3. List it with tar tvf, check the top level and the permissions, then hand it on.

XZ and TAR: the compressor and the layer that holds the names

XZ compared with TAR
XZTAR
Full nameXZ ArchiveTape Archive
File extension.xz.tar
Media typeapplication/x-xzapplication/x-tar
CompressionLossless — nothing is discardedUncompressed
First published20091979
SpecificationPOSIX.1-2001 ustar
LicensingOpen standardOpen standard
Standing todayCurrentCurrent
Opens in a browserNo browserNo browser
Considered insteadGZ, BZ2, 7ZZIP, GZ

What survives

Nothing is discarded. XZ and TAR both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

What the target format adds

TAR is a working format and XZ is a finished one. What comes back is editable text and objects rather than a picture of a page, which is usually the reason for the conversion and also where its limits are.

Opening the result

TAR holds a directory of files, where XZ is a single compressed stream. Names, folders and dates are recorded rather than flattened into one blob.

7-Zip and Keka read both XZ and TAR, so there is a way to check the result against the original without a second tool.

File size and quality

TAR stores the samples raw, so the file grows substantially without gaining anything. It is the right direction only when a program on the far side refuses XZ, which is the usual reason for doing it.

What each format is for

TAR dates from 1979, specified as POSIX.1-2001 ustar. tar, 7-Zip and Keka all read it.

TAR was published in 1979 and XZ in 2009. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

XZ to TAR: size, checksums and the tools that need a tarball

Are my XZ files uploaded anywhere?

Yes — this conversion needs software that cannot run in a browser, so the file is uploaded over an encrypted connection. It is deleted as soon as the job finishes, and the result is sent straight back to you without being stored. The work is done by 7-Zip, the archiver, in its command-line form.

How much larger will the TAR be?

As large as the contents actually are, which on text can be many times the size of the XZ. That is the whole point of removing the compression, and it is why this conversion is worth planning for rather than running casually — an archive that fitted in an email attachment will not fit afterwards.

Is the TAR I get back identical to the one inside the .tar.xz?

No, and this matters. The archive is extracted and a fresh tarball is written from the contents, so member order, recorded timestamps and permission bits can differ. Any checksum published against the upstream tarball will not match. If a hash has to verify, decompress with `xz -d` on your own machine, which leaves the tarball untouched.

Why would anyone want an uncompressed archive?

Because the next tool insists. `docker load` takes a tarball, various appliance and firmware importers take a tarball, and some signing, diffing and content-addressed storage steps want the uncompressed bytes so that a small change does not rewrite the entire file.

What if the .xz did not contain a tarball?

Then the single file it held becomes the only member of the TAR you get back. XZ compresses one stream, so an `.xz` is either a compressed tarball or a compressed single file; the converter tries to unwrap an inner TAR and, when there is not one, keeps the plain file.

Do file names and folders survive?

Yes — a TAR is precisely the layer that carries them. Names, paths, nested directories and the recorded owner, group and mode all have fields in a TAR header, which is why the Unix world pairs it with compressors that have none of that.

What is the size limit?

25 MB on the file you upload, on the free tier, because this pair runs on our server rather than in your browser. Since the output is uncompressed the download can be very much larger than that, and the archive is refused before extraction if it declares an expansion above 2 GB.

More about these formats