Create TAR.GZ File

Create a TAR.GZ (tgz) file online: pack files and folders into a gzip-compressed tarball, the standard Linux archive format. Free and private, no upload.

Files are processed in your browser and never uploaded.

How to create a TAR.GZ file

  1. Drop files onto the drop zone above or click Choose files. Click Add a folder, or drag a folder in, to pack an entire directory tree.
  2. Set the Archive name. The default archive becomes archive.tar.gz.
  3. Click Create TAR.GZ. The files are bundled into a tar stream, which is then gzip-compressed.
  4. Download the tarball with the Download button.

Both steps take place inside your browser; gzip compression uses the browser's built-in compression engine. Your files are not uploaded.

The standard archive of the Unix world

The tarball is how source code, website backups, and Linux and macOS software have been passed around for decades. It works in two layers. Tar first records every file with its path and modification time in one continuous stream. Gzip then compresses that stream with Deflate, the same algorithm used by ZIP.

Because gzip compresses the whole stream rather than each file on its own, a tarball can be smaller than a ZIP when you have many small, similar files, such as a code repository or a folder of HTML pages. On the other hand, a ZIP lets you extract one file instantly, while a tarball must be read from the start.

You will see two spellings: .tar.gz and the shorter .tgz. They are identical; this tool uses .tar.gz, which is the more common name. Some upload forms only accept one of them, in which case you can safely rename the file.

When to pick gzip over bzip2 or xz

Gzip is the fastest of the three common tar compressors and is supported absolutely everywhere, including by hosting control panels, deployment tools and Python, Node.js or PHP libraries. If a server or service asks for a "tarball" without saying more, .tar.gz is almost always what it expects. Choose xz only when the smallest possible download is worth the extra compression time.

Archives are written in POSIX pax tar format, so long paths and non-English file names are preserved, and the original modification dates are kept. Empty folders are not stored.

Doing the same on the command line

The equivalent command is tar -czf archive.tar.gz folder/, where c creates, z compresses with gzip and f names the output. To check the contents afterwards, run tar -tzf archive.tar.gz. These work on Linux, macOS, and in Windows 10 and 11 Command Prompt.

Tips

  • To open a tarball someone sent you, use Extract TAR.GZ.
  • For better compression on text-heavy folders, compare the result with Create TAR.XZ.
  • Have an existing ZIP that a Linux server should receive as a tarball? ZIP to TAR.GZ converts it.
  • Need to compress a single file without tar? Use the GZIP Compressor.

Frequently asked questions

Can Windows open a .tar.gz file?

Recent versions of Windows 11 open it in File Explorer, and Windows 10 and 11 both include tar.exe for the command line. 7-Zip also handles it.

Are file permissions saved?

Files are stored with standard read/write permissions because the browser does not expose Unix permission bits. Set executable flags after extracting if needed.

What is the maximum size?

The archive is built in memory. Totals above roughly 700 MB are slow, and over 2 GB is refused.

Copied to clipboard