TAR.GZ Creator
Bundle multiple files or folders into a tar archive entirely in your browser, then compress it with gzip and download it in whichever format you need: .tar.gz, .tgz, .tar (uncompressed), or .gz (single file). Handy for uploading to a Linux server. Files are never sent to a server.
What this TAR.GZ creator does
This tool bundles several files or folders into a single tar.gz archive — or a tgz, tar or gz file. Everything is done on your own device using the Compression Streams API built into the browser, so the contents are never uploaded to any server. That makes it safe to use even for confidential documents or files containing personal data.
Four output formats are available. A .tar.gz collects the files with tar and then compresses them with gzip; it is the most common form and is widely used for uploading to Linux servers and for distribution. A .tgz is exactly the same thing under a shorter extension. A .tar skips compression entirely, while a .gz compresses a single file directly without going through tar — pick whichever suits the task.
How to create an archive
- Add files or folders Drag and drop them onto the drop area, or add them with the buttons for selecting files or a folder.
- Check the file name Review the name of the archive to be produced in the input field and change it to something meaningful if you wish.
- Choose the output format Select .tar.gz, .tgz, .tar or .gz to suit the purpose. The .gz option is available only when there is a single file.
- Create the archive and download it Pressing the create-and-download button runs the compression in the browser and the file is saved automatically.
Tips for getting more out of it
- Drop a whole folder and it will be bundled into the tar with its original folder structure preserved. If you select individual files instead, the resulting archive will be flat, with no folder structure.
- .tar.gz and .tgz are identical in content — only the extension differs. If you're handing the file to a tool that expects the .tgz extension, such as an npm package, choose .tgz.
- Choosing ".tar (no compression)" skips the gzip step. When bundling files that are already compressed — images, video, ZIP files, and the like — the size barely changes either way, so skipping compression is faster.
- .gz is an old-fashioned format that compresses a single file directly without using tar. It can only be selected when there is exactly one file, such as when you just want to compress a single log file.
- Bundling a huge number of files, or very large files, can take a while since everything is processed in your browser's memory — and it may even fail depending on your device. For anything from a few hundred megabytes up to several gigabytes, we recommend splitting the job into a few smaller archives.
When this is useful
Preparing an upload to a Linux server
Packing an entire website or project folder into a tar.gz means an upload over SSH, or a deployment, becomes a single file transfer.
Producing a .tgz package for npm
You can build a distributable for tools that expect the .tgz extension, such as npm packages, without installing a dedicated command-line tool.
Archiving log files together
Rolling a set of daily logs into one tar.gz cuts down the number of files you have to store or hand over.
Passing several files around without a server
Instead of attaching many files to an email or a chat message, send one archive — and because the compression happens entirely on your machine, nothing is entrusted to an outside service.
Backing up while preserving folder structure
Dropping a folder in keeps the original hierarchy inside the archive, which is what you want when saving a set of configuration files exactly as they are arranged.
Terms used with tar and gzip
- tar
- A format and command for collecting several files into one, short for Tape ARchive. It has no compression of its own.
- gzip
- A format and command for compressing data. Compressing a tar file with gzip is what produces a tar.gz.
- .tgz
- A shorter extension applied to an archive whose contents are identical to a .tar.gz. It is a legacy of older systems that required file names of eight characters or fewer.
- PAX header
- An extended header devised for handling long paths, because the older tar format could store a file name of only up to 100 bytes.
- Compression Streams API
- A web API built into browsers that exposes gzip compression and decompression directly to JavaScript, allowing the work to be completed on the client without a server.
- ustar format
- The tar header format standardised by POSIX. Its file-name field is limited to 100 bytes, and anything longer is handled with a PAX header.
Frequently Asked Questions
Side Note — tar's 512-Byte Blocks and the PAX Extended Header
The tar file format was designed in the 1970s for magnetic tape drives (Tape ARchive), so its data is divided into 512-byte "blocks." When a file's contents aren't an exact multiple of 512 bytes, zero-padding is added at the end to round it up to the next block boundary. Thanks to this simple structure, tar remains an easy format to implement and one that works well with streaming, even today.
The header in the old ustar format reserves only 100 bytes for the filename field. Bundling deeply nested folders or long filenames into a tar can exceed this limit. The PAX extended header was devised to solve this: it inserts a special block recording the "real name" immediately before the actual entry, effectively working around the length restriction. This tool automatically adds a PAX extended header for any path longer than 100 bytes.
Unlike ZIP, the tar-plus-gzip combination has no password-protection mechanism. That's because tar is designed to do just one thing — bundling — and gzip is designed to do just one thing — compressing. If you need to distribute sensitive files, use our sister tool, the ZIP Creator, which supports encryption.