Skip to content
Aback ZIP

How-to · 6 min read · Updated

How to create a TAR.GZ file

Bundle files and folders into .tar or .tar.gz on Windows, macOS, Linux or in your browser, keeping paths and file times. See which TAR filters Aback ZIP writes.

A .tar.gz file is a TAR archive compressed with GZIP, the standard packaging format for Linux servers and source releases. Create TAR builds one in your browser from files and folders, preserving paths, file times and long or non-English names. If you only want to compress a single file, use GZIP Compress & Extract instead; TAR is for collections of files.

What TAR and GZIP each do

These are two separate jobs that happen to be chained together. TAR (short for tape archive) concatenates files and folders into one stream, recording each name, size, modification time, permission bits and, where relevant, whether an entry is a symbolic link. GZIP then compresses that stream. The result is conventionally named .tar.gz or .tgz.

NameWhat it isWhen to use it
.tarUncompressed archiveWhen another compressor will be applied, or on a fast local disk
.tar.gz / .tgzTAR compressed with GZIPThe common choice for source releases and Linux software
.zipArchive with its own compression and indexSharing with Windows and macOS users who just want to open it

Aback ZIP writes .tar and .tar.gz. It can read .bz2, .xz and .zst TARs but does not create those formats; GZIP is the only TAR filter it writes.

Create a TAR.GZ in your browser

  1. Open the Create TAR tool and add files or whole folders. Adding a folder keeps its relative paths, so project/src/app.ts stays at that path inside the archive.
  2. Review the list. Remove anything you do not want to ship, such as caches, build output or private notes.
  3. Choose whether to GZIP-compress the archive. A .tar.gz is usually much smaller for text, source code, logs and other repetitive data.
  4. Name the archive and create it. Download the result when it is ready. Your original files are only read, never changed.

Long and non-English names are stored with standard pax headers, so résumé.pdf, 文件.pdf and deep paths survive. File modification times are written into the TAR headers rather than reset to the current time.

Archiving runs in a browser Web Worker. The page stays responsive during large jobs and you can cancel before the download is prepared.

Create one with tar on Linux or macOS

The tar command is installed by default on almost every Linux distribution and on macOS. The -c flag creates an archive, -z applies GZIP, -v lists files as they are added and -f names the output:

tar -czvf project.tar.gz project/

To see what would be included without writing anything, use tar -tzf project.tar.gz on an existing archive, or dry-run with a plain tar -cf /dev/null project/ on Unix. On macOS, Finder can also Compress a folder, but it produces a ZIP and adds AppleDouble metadata; TAR avoids that.

On Windows, 7-Zip can create .tar and .tar.gz from the right-click menu. Windows 11 can open TAR.GZ files but cannot create them from File Explorer.

What to leave out

  • Version-control data: .git and .svn directories are rarely wanted in a release.
  • Dependencies: node_modules, virtual environments and vendored packages can be reinstalled.
  • Build output: compiled files that will be rebuilt on the target machine.
  • Secrets and personal files: credentials, tokens, private keys and local configuration files are easy to include by accident.
  • OS clutter: .DS_Store, __MACOSX and Thumbs.db are noise in an archive meant for other systems.

If your source is already a ZIP, ZIP to TAR converts it directly instead of extracting and repacking by hand.

Check the archive before you send it

  1. List the contents with tar -tzf archive.tar.gz or open it in Extract TAR and browse the tree.
  2. Confirm the top-level folder is what you expect. A release that unpacks into dozens of loose files is awkward to use.
  3. Extract one file and compare it with the original if the transfer matters.

GZIP has an integrity trailer, but TAR has no checksum per file by default. If you need per-file verification, ZIP's stored CRC-32 is the more convenient format.

Choosing between TAR.GZ and ZIP

Use TAR.GZ when the recipient is on Linux or macOS, expects Unix permissions and symbolic links, or works with package managers and source releases. Use ZIP when you want a file that anyone can double-click on Windows, macOS or Linux. ZIP vs TAR and ZIP vs TAR.GZ for developers go into the details. Nothing here is uploaded: the archive is assembled locally in your browser.

How TAR stores a folder

A TAR file is a simple sequence of blocks. Each file or folder gets a header block holding its name, size in bytes, modification time, permission bits, owner fields and a type flag that says whether it is a regular file, a directory or a symbolic link. The file's data follows, padded so the next header starts on a boundary. A pair of zero blocks marks the end. This is why TAR is still the default for software releases: a damaged TAR can often be read up to the point of damage, and almost any Unix system can recreate it.

The classic header has tight limits on name length and numeric fields. Modern writers use pax extended headers, which store long names, large sizes, high-resolution timestamps and non-ASCII paths in a special preceding entry. Aback ZIP uses these standard pax records when needed, so a deep folder tree or a name with Japanese characters does not get truncated. Older extractors may show the fallback short name instead; that is a limitation of the reader, not of the archive.

  • Directories are real entries, not just prefixes on file names. An empty folder survives because its header is present.
  • Paths are relative to wherever you extract. A leading slash is normally stripped by safe extractors, and Aback ZIP neutralises unsafe paths so an entry cannot write outside the destination folder.
  • File times are stored as numbers, usually seconds since the Unix epoch. Timezone information is not part of the format, so the same archive shows different local times in different places.
  • Permissions are numeric bits. They matter on Linux and macOS and are mostly ignored on Windows, which is one reason a TAR built for a server should stay a TAR.

If you plan to hand the archive to Windows users, remember that the TAR structure itself is not natively understood there. Converting it to ZIP is often friendlier, though that loses some Unix-specific metadata. Keeping both formats is a reasonable compromise when the same package has two audiences.

GZIP sits around this stream as a single compressed layer. It has a small header and an eight-byte trailer with a CRC-32 and the original size, which is why a TAR.GZ can be checked for truncation without unpacking it.

Tools for this

Frequently asked questions

.tar is an uncompressed archive. .tar.gz is that archive compressed with GZIP, and .tgz is simply a shorter name for the same thing.

More guides