How to compress files with gzip, bzip2 or xz
- Drop one or more files onto the drop zone above, or click Choose files.
- Pick a Format:
- GZIP (.gz) – fast and understood by practically every system and library.
- BZIP2 (.bz2) – usually smaller than gzip on text, but slower.
- XZ (.xz) – usually the smallest result, with the slowest compression.
- Click Compress. Each file is compressed on its own and keeps its full name plus the new extension, so
report.csvbecomesreport.csv.gz. - Download each result with its Download button, or use Download all (ZIP) when you compressed several files.
GZIP output is produced by your browser's built-in CompressionStream; BZIP2 and XZ use libarchive compiled to WebAssembly. Your files are not uploaded.
Compressors, not archivers
gzip, bzip2 and xz each turn one input into one compressed output. They have no notion of folders or a list of files, which is why this tool produces a separate .gz, .bz2 or .xz for every file you add. If you want several files inside a single download, put them in an archive first: on Unix systems that means tar, giving the familiar .tar.gz.
A single compressed file is still the right choice in many cases: a large SQL dump or CSV export to upload to a server, a log file to attach to a support ticket, a pre-compressed asset for a web server that serves .gz files directly, or a data file for a script that reads gzip natively.
| Format | Algorithm | Decompress on Linux/macOS | Good for |
|---|---|---|---|
| GZIP (.gz) | Deflate | gunzip file.gz | Logs, web assets, anything needing wide support |
| BZIP2 (.bz2) | Burrows-Wheeler + Huffman | bunzip2 file.bz2 | Text where gzip is not small enough |
| XZ (.xz) | LZMA2 | unxz file.xz | Large text or data files for download |
The command-line equivalents for compressing are gzip -k file, bzip2 -k file and xz -k file, where -k keeps the original next to the compressed copy. Without it, the original file is deleted.
Things to keep in mind
- Photos, videos, PDFs, Office documents and ZIP files are already compressed internally, so any of the three formats will make them only marginally smaller.
- The site can decompress
.gzfiles, but not single-file.bz2or.xzfiles. Recipients of those needbunzip2,unxz, 7-Zip or a similar tool. - Files over about 700 MB are slow to process in the browser, and inputs over 2 GB are refused.
Tips
- To pack several files or a folder into one compressed file, use Create TAR.GZ or Create ZIP.
- To open a
.gzfile, use Open GZ Files. - Want a protected file instead of just a smaller one? Password Protect Any File packs files into an AES-256 encrypted ZIP.
Frequently asked questions
Can I compress a whole folder into one .gz?
Not directly, because gzip only holds one file. Create a TAR.GZ instead, which bundles the folder with tar and then gzips it.
Can I choose the compression level?
No. The only option is the format; the compression settings are fixed.
Which format gives the smallest file?
Usually XZ, followed by BZIP2 and then GZIP, but the gap depends on the content. Try two formats on the same file and compare the sizes.