tar Command Generator — Build & Decode tar Commands

Nobody remembers tar flags. Pick what you want and get the exact command — with every flag explained. Or paste a tar command and have it decoded. Runs entirely in your browser, no signup.

Your command

Or: decode a tar command

Paste any tar command — every flag gets explained.

The tar flags, demystified

The reason tar feels impossible is that one letter changes everything. The core three are mutually exclusive — pick exactly one: c create, x extract, t list. Everything else is a modifier. The two you'll always want are f (the archive filename comes next) and v (verbose, so you can see what's happening). So tar -czvf out.tar.gz dir/ reads as "create, gzip, verbose, file out.tar.gz from dir/".

Which compression should I use?

Gotchas worth knowing

Frequently asked questions

How do I extract a .tar.gz file?

tar -xzvf file.tar.gz — extract, gzip, verbose, file. On modern tar even tar -xf file.tar.gz works because it auto-detects gzip.

What does tar -xzvf mean?

x extract, z through gzip, v verbose (print each file), f the archive filename follows. It's the classic "unzip a .tar.gz" command.

How do I create a tar.gz of a folder?

tar -czvf archive.tar.gz folder/. Add --exclude='*.log' to skip files, or -C parentdir folder to control the paths stored inside.

gzip vs zstd vs xz — which is best?

zstd for the best speed-to-size balance, xz for the smallest files, gzip for maximum compatibility. All three are one flag apart.

Working with permissions too? See the chmod calculator, or browse all tools on the home page.