Archive Converter

Published Updated

Repack a ZIP archive as an uncompressed TAR file.

What carries over and what does not

The converter reads the ZIP's central directory, inflates each Deflate entry with the browser's DecompressionStream, and writes a fresh ustar archive. It keeps file names and contents. It does not keep timestamps, permissions, owners or symbolic links, because the tool sets those fields itself.

So it is a good fit for handing a folder of plain files to someone who wants a tarball, and a poor fit for software packages, backups with permissions, or anything that depends on executable bits.

The header the tool writes for each file

Field sizes are from the ustar layout in the POSIX pax specification.

FieldValue writtenLimit
nameThe path inside the ZIP100 bytes. A longer path is split at a slash into prefix and name, or written in full in a PAX header
mode0000644Same for every file
uid, gid0No owner names
mtimeTime of conversionNot the ZIP's dates
typeflag0, regular fileNo links or directories
prefixFront part of a long path155 bytes, left empty for short paths

How size adds up

A TAR is easy to predict. Each file takes 512 bytes for its header plus its data rounded up to a multiple of 512, and the archive ends with 1,024 bytes of zeros. A path too long for the header fields adds at least 1,024 bytes for that file, for its PAX header and data.

A check with three files of 1,000, 513 and 512 bytes gives 3 x 512 header bytes, 1,024 + 1,024 + 512 bytes of data and 1,024 bytes at the end: 5,120 bytes in total, which is what the encoder produces.

  • A ZIP that holds 40 MB of text can inflate to the same 40 MB or more in the TAR.
  • Many tiny files waste space, since each non-empty file costs at least 1,024 bytes.

Converting a ZIP to a TAR

  1. Step 1

    Add a ZIP file

    Pick one .zip archive. Only ZIP is accepted as input.

  2. Step 2

    Press Convert Archive

    Every file is unpacked in memory and written into a new TAR. Empty folders are skipped.

  3. Step 3

    Check the list and download

    The result card lists the files that went in. Download the .tar, which has the same base name.

ZIP details that matter

ZIP stores a compression method per file, and this reader handles only Stored and Deflate. The PKWARE APPNOTE defines the rest. The tool needs a browser with DecompressionStream, which means Chrome 103, Firefox 113 or Safari 16.4 and later. For backups and software, use the real tar command on your computer.

Checked against a TAR program on real ZIP files

We made the test ZIPs with Info-ZIP zip 3.0 (the build that ships with macOS), ran the site's own ZIP reader and TAR writer (lib/zipParser.ts and lib/tarEncoder.ts) in Node 22.23.1, and then listed and extracted the TAR with bsdtar 3.5.3 (libarchive 3.7.4). The files are generated text and random bytes, not anyone's documents.

What we put in the ZIPWhat bsdtar showed in the TAR
Three files: 20,000 bytes of text, 50,000 random bytes and an 18-byte script with the executable bit set, inside two foldersAll three extracted with the same SHA-256 as the originals. The script was listed as -rw-r--r-- (mode 0644) and not as 755. The ZIP was 53,811 bytes and the TAR 73,728.
An empty folder next to those filesNot in the listing.
Two files named report_first_version.txt and report_second_version.txt in a folder path of 137 charactersBoth were listed by bsdtar and extracted with their own names and contents. Two more files with paths of 383 characters, and one with a long Japanese folder name, were kept in full too.
File names with an accented e and with Japanese charactersWritten as UTF-8 and listed back by bsdtar as the matching byte sequences.
A script file with a modification date in 2020Listed with the date and time of our run, not 2020.

Size of the TAR for different kinds of content

The TAR is not compressed, so its size depends on how many files there are and how well the ZIP had squeezed them. These are single runs of the same code in Node.

Content of the ZIPZIPTAR
1 text file of 100 bytes227 B2,048 B
10 text files of 100 bytes each2,058 B11,264 B
100 text files of 100 bytes each20,481 B103,424 B
1,000 text files of 100 bytes each206,174 B1,025,024 B
One 5 MB text file702,395 B5,244,416 B
One 5 MB file of random bytes5,243,844 B5,244,416 B

Small files cost about 1,000 bytes each in a TAR, so a ZIP of 1,000 tiny files came out about five times larger. Random bytes do not compress, so the ZIP and the TAR are almost the same size. A text file shrank to about 13 percent in the ZIP, and the TAR gives that saving back.

When the ZIP cannot be read

We ran the same reader in three engines on small generated ZIPs: Chromium 153.0.8010.12 (the build that ships with Playwright, headless, not Google Chrome), Firefox 155.0 and Playwright's WebKit build (user agent Version/26.6, not the Safari app). The ZIP file with a 20,000-byte text file converted to a 22,016-byte TAR in all three.

ZIP fileWhat the reader reported
Compressed with bzip2, or with LZMAThe same message in all three engines: the file name, then that only Stored and Deflate are supported.
A text file, not a ZIPThe same message in all three: no End of Central Directory record found.
Only an empty folderThe reader returns no files, and the page then says the archive does not contain any files.
Password-protected (zip -P, the older encryption)The page names the ZIP file and the first encrypted entry and says password-protected archives are not supported. The check reads a flag in the archive, so the unpacking code of the browser is not reached for that entry. Checked in Node.

ZIP to TAR questions

Does the TAR keep file permissions and dates?

No. Every file is written with mode 0644, owner and group 0, and the modification time is the moment you converted. A shell script will lose its executable bit, so run chmod +x after extracting.

Are long file paths kept?

Yes. A path of up to 100 bytes goes in the name field. A longer one is split at a slash between the 155-byte prefix field and the name field, and a path too long even for that is written in full in a PAX extended header, which bsdtar reads (tested with bsdtar 3.5.3). If the ZIP holds two entries with the same path, the second is renamed, for example report.txt becomes report (2).txt, so neither is lost on extraction.

Why is the TAR bigger than my ZIP?

TAR does not compress. The size is the total of all files, each padded to a multiple of 512 bytes with a 512-byte header, plus 1,024 bytes at the end. A path too long for the header fields adds at least 1,024 bytes for that file. Text often compresses to a fraction of its size inside a ZIP.

Can I get a .tar.gz instead?

No, the output is a plain .tar. Compress it afterward with gzip on a computer if you need a tarball.

Which ZIP files fail?

Archives that use compression other than Stored or Deflate, password-protected ZIPs, and any single file over 500 MB once decompressed. For an unsupported compression method or a password-protected ZIP, the page names the file and says what is not supported.

Are empty folders kept?

No. Only files are written, with their folder names as part of each path, so an empty directory has nothing to record and disappears.

What happens to two files whose long paths start the same?

Both are kept. In our test, two files in a folder path of 137 characters and two more with paths of 383 characters were all listed by bsdtar 3.5.3 and extracted with their full names and the same contents as in the ZIP.

What happens with a password-protected ZIP?

The tool does not decrypt ZIPs. It reads each entry's encryption flag before unpacking that entry and shows a message that names the ZIP file and the encrypted entry and says password-protected archives are not supported. Remove the password with the program that made the archive, then convert it again. We checked the reader in Node with a ZIP made by Info-ZIP zip 3.0 using its -P option (the older encryption).

Related Tools