Skip to main content
Filesvo

How to Create a tar.gz File

To create a tar.gz file, drop your files into the tool below and choose .tar.gz — the archive is built inside your browser and nothing is uploaded. In a terminal the same thing is tar -czf archive.tar.gz folder/. Both produce a tar archive that has then been gzipped, and for sharing or uploading they are interchangeable. There is one real difference between them, and it is the section directly under the tool.

Create a .tar or .tar.gz archive

or drag and drop the files to pack here — any file type works

Processed on your device — files are never uploaded to Filesvo.

The browser cannot preserve file permissions — the terminal can

A tar archive stores a Unix mode, owner and group for every file. That is the whole reason source releases ship as .tar.gz: unpack one and the scripts inside are still executable.

A web page gets none of that. The browser's file API hands JavaScript a name, a size, a type and a modified time, and nothing else — the mode bits are simply not exposed. So every file this tool writes is recorded as mode 644, owner 0, group 0. Nothing is lost from the file contents, but an executable comes back non-executable.

For sending files to someone, attaching them to a ticket or satisfying an upload form that wants a tarball, that does not matter at all. For a backup, a deployable release, or anything where the executable bit has to survive, use the tar command below instead. No browser tool can do that part honestly, including this one.

The tar commands worth remembering

Every command below was run and its output checked before being listed here. They work as written on macOS, Linux and Windows — all three ship a tar command.

What you wantCommand
Create a .tar.gz from a foldertar -czf archive.tar.gz folder/
Create an uncompressed .tartar -cf archive.tar folder/
Create one from specific filestar -czf archive.tar.gz a.txt b.txt
Leave files outtar -czf archive.tar.gz --exclude='*.log' folder/
See what is inside, without extractingtar -tzf archive.tar.gz
Extract into the current foldertar -xzf archive.tar.gz
Extract somewhere elsetar -xzf archive.tar.gz -C /path/to/dir
Extract a single filetar -xzf archive.tar.gz folder/a.txt
Watch it work on a big archivetar -czvf archive.tar.gz folder/

The letters are the whole trick: c creates, x extracts, t lists; z means gzip; f names the file; v prints each entry as it goes.

Why the name has two extensions

Because two separate programs ran. tar (tape archive) does one job — it concatenates many files into one, keeping their names, folder structure, timestamps and permissions. It does not compress anything; a .tar file is usually slightly larger than the files that went into it.

Compression is gzip's job, and it runs afterwards on the finished .tar as a single stream. So .tar.gz literally reads as: a tar archive, gzipped. The -z flag just saves you piping one into the other by hand.

.tgz is the same file with a shorter name, from the era of filesystems that allowed only three characters after the dot. Nothing about the contents differs, and every tool that opens one opens the other.

tar.gz vs ZIP: which is actually smaller

It depends on what you are packing, and the usual blanket claim that tar.gz wins is only true for one of the three cases below. Packing the same files both ways, at maximum ZIP compression:

176 small source files (1.6 MB of text): tar.gz came out 376 KB against ZIP's 445 KB — 15% smaller. 14 already-compressed files (PNG and WOFF2, 32 MB): 166 KB against 169 KB, a 2% difference that is effectively nothing. 8 larger text files: ZIP was about 1% smaller.

The reason is structural. ZIP compresses each file on its own and stores the results side by side. tar hands gzip one continuous stream, so gzip can reuse a pattern it saw in file 3 while compressing file 150. When the files resemble each other — source code, logs, config — that shared history is a real saving. When each file is large, or already compressed, there is nothing to share and the two formats land in the same place.

That is one measurement on one machine, not a law. But it is the right shape of answer: many small similar files favour tar.gz, and everything else is a coin toss.

Where tar.gz genuinely costs you

Pulling one file out. A ZIP keeps an index at the end listing every entry and its exact offset, so a tool can jump straight to the file you asked for. A .tar.gz has no usable index, because gzip compressed the entire archive as one stream — to reach the last file, everything before it has to be decompressed first.

The command still works — tar -xzf archive.tar.gz folder/a.txt does what you expect — but on a multi-gigabyte archive it grinds through the whole thing to find one file. If people will regularly pull single items out of the archive, make a ZIP instead.

Opening one on Windows

Windows has shipped a tar command since Windows 10 build 17063, so tar -xzf archive.tar.gz works in Command Prompt and PowerShell with nothing installed. Windows 11's File Explorer can also extract .tar.gz directly from the right-click menu.

On older machines, or when you would rather not touch a terminal, the TAR extractor here opens .tar, .tar.gz and .tgz in the browser, and the TAR to ZIP converter repacks one as a ZIP that any version of Windows opens natively.

Frequently asked questions

What is the difference between .tar.gz and .tgz?
Nothing. They are the same format with two spellings, and .tgz exists only because some old filesystems allowed just three characters after the dot. Any tool that opens one opens the other.
Is tar.gz better than ZIP?
For many small similar files, yes — measured on 176 source files, tar.gz was 15% smaller than ZIP. For already-compressed files or a handful of large ones, the two are within about 2% of each other. ZIP wins when people need to pull single files out, because tar.gz has no index to jump to.
Does the browser tool keep file permissions?
No, and it cannot. Browsers do not expose Unix mode bits to a web page, so every file is written as mode 644 owned by root. File contents are untouched, but an executable will come back non-executable. Use the tar command for anything where that matters.
How large an archive can I build here?
Up to 1,000 files totalling 500 MB. The limit exists because everything is held in your browser's memory — there is no server to hand a larger job to.
Are my files uploaded anywhere?
No. The archive is assembled by JavaScript in this page, and gzip runs through the browser's own CompressionStream API. Nothing leaves your device, so there is nothing for Filesvo to store.
Why is my .tar bigger than the files I put in it?
Because tar does not compress. It adds a 512-byte header per file and pads every entry to a 512-byte boundary, then appends an end marker. Choose .tar.gz to compress the result.