Free GZ sample files
A single compressed file. The compression used for web responses and Unix tools. Download valid GZ test files in 6 exact sizes, from 1 KB to 10 MB, each with a checksum.
- Extension
- .gz
- MIME type
- application/gzip
- Kind
- Binary
- Category
- Archives
GZ files by size
Every file below is a valid Gzip compressed file file of exactly the stated size. Open a file's page for its checksum and contents. GZ files cannot be displayed by a browser, so their pages show the file's details instead of a preview.
| File | Size | Contents | Download |
|---|---|---|---|
| 1 KB GZ samplesample-gz-1kb.gz | 1 KB1,024 bytes | Uncompressed size: 5,806 bytes | Download GZ |
| 10 KB GZ samplesample-gz-10kb.gz | 10 KB10,240 bytes | Uncompressed size: 111,533 bytes | Download GZ |
| 100 KB GZ samplesample-gz-100kb.gz | 100 KB102,400 bytes | Uncompressed size: 1,180,002 bytes | Download GZ |
| 1 MB GZ samplesample-gz-1mb.gz | 1 MB1,048,576 bytes | Uncompressed size: 12,226,979 bytes | Download GZ |
| 5 MB GZ samplesample-gz-5mb.gz | 5 MB5,242,880 bytes | Uncompressed size: 61,140,408 bytes | Download GZ |
| 10 MB GZ samplesample-gz-10mb.gz | 10 MB10,485,760 bytes | Uncompressed size: 122,374,315 bytes | Download GZ |
More GZ samples
Hand-designed files with realistic content or a specific edge case.
| File | Size | Contents | Download |
|---|---|---|---|
| Sample .tar.gz archive (double extension)sample-archive.tar.gz | 1.02 KB1,040 bytes | Entries: 3 files in 1 folder | Download GZ |
What is a GZ file?
Gzip compresses one stream of data with the deflate algorithm and wraps it in a small header and a trailer holding a CRC-32 checksum and the original length. It does not bundle multiple files; that is tar's job.
The same compression is used for HTTP responses with Content-Encoding: gzip, which is a frequent source of confusion when downloading .gz files.
How to recognise a GZ file
| Extension | .gz |
|---|---|
| MIME type | application/gzip |
| Also seen as | application/x-gzip |
| Specification | RFC 1952 |
| Compression | Deflate (RFC 1951) |
| Integrity | CRC-32 and length of the uncompressed data |
| Optional header fields | Original file name, comment, extra data |
What to test for
These are the behaviours that most often go wrong when software handles GZ files.
- If a server sends a .gz file with Content-Encoding: gzip, the client transparently decompresses it and saves a file whose content does not match its name.
- A small .gz can decompress to gigabytes. Stream and cap the output rather than inflating it into memory.
Strengths of GZ
- Fast, universally available compression.
- Can be decompressed as a stream without knowing the size in advance.
Limitations of GZ
- Holds a single file; bundling needs tar as well.
- No random access: reaching the end means decompressing everything before it.
Typical uses of GZ test files
- Testing decompression of uploads and log archives
- Checking Content-Encoding handling in HTTP clients
- Testing streaming decompression
Software that opens GZ
- gzip and gunzip
- 7-Zip and most archive tools
- zlib bindings in every language
Specifications
Related
GZ sample files: questions
- What do the sample .gz files decompress to?
- A text file named sample.log containing web-server access log lines. The uncompressed size is shown on each download page.
- What is the MIME type of a GZ file?
- The MIME type is application/gzip. You will also meet application/x-gzip in practice. The file extension is .gz.
- Is a sample GZ file the same as a dummy or example GZ file?
- Yes. Sample, test, dummy and example GZ files are different names for the same thing: a GZ file with known contents that stands in for a real one. Any file on this page will do wherever a tutorial or a test plan asks for a dummy GZ file.