Free GZ sample, test and dummy files

A single compressed file. The compression used for web responses and Unix tools. Download valid GZ test files in 19 exact sizes, from 1 KB to 100 MB, each with a checksum. Or create one of any size up to 1 GB.

Extension
.gz
MIME type
application/gzip
Kind
Binary
Category
Archives

Create a GZ file of any size

Choose any size from 35 bytes to 1 GB. The file is made in your browser, so nothing is downloaded from our server. Smaller files usually finish quickly; generation time depends on your device and format. Larger ones are streamed straight into your downloads list in browsers that support it (current Chrome, Edge and Firefox on computers and Android); elsewhere, such as Safari and every browser on iPhone and iPad, the largest size is lower and is shown below.

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.

GZ sample files by size
FileSizeContentsDownload
1 KB GZ samplesample-gz-1kb.gz 1 KB1,024 bytes Expands to 0 bytes Download GZ
5 KB GZ samplesample-gz-5kb.gz 5 KB5,120 bytes Expands to 5,074 bytes Download GZ
10 KB GZ samplesample-gz-10kb.gz 10 KB10,240 bytes Expands to 48,595 bytes Download GZ
25 KB GZ samplesample-gz-25kb.gz 25 KB25,600 bytes Expands to 180,209 bytes Download GZ
50 KB GZ samplesample-gz-50kb.gz 50 KB51,200 bytes Expands to 394,687 bytes Download GZ
100 KB GZ samplesample-gz-100kb.gz 100 KB102,400 bytes Expands to 829,990 bytes Download GZ
200 KB GZ samplesample-gz-200kb.gz 200 KB204,800 bytes Expands to 1,695,788 bytes Download GZ
500 KB GZ samplesample-gz-500kb.gz 500 KB512,000 bytes Expands to 4,295,458 bytes Download GZ
1 MB GZ samplesample-gz-1mb.gz 1 MB1,048,576 bytes Expands to 8,849,004 bytes Download GZ
2 MB GZ samplesample-gz-2mb.gz 2 MB2,097,152 bytes Expands to 17,755,005 bytes Download GZ
3 MB GZ samplesample-gz-3mb.gz 3 MB3,145,728 bytes Expands to 26,647,183 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
15 MB GZ samplesample-gz-15mb.gz 15 MB15,728,640 bytes Expands to 133,430,383 bytes Download GZ
20 MB GZ samplesample-gz-20mb.gz 20 MB20,971,520 bytes Expands to 177,941,529 bytes Download GZ
25 MB GZ samplesample-gz-25mb.gz 25 MB26,214,400 bytes Expands to 222,456,326 bytes Download GZ
30 MB GZ samplesample-gz-30mb.gz 30 MB31,457,280 bytes Expands to 266,972,214 bytes Download GZ
50 MB GZ samplesample-gz-50mb.gz 50 MB52,428,800 bytes Expands to 440,224,278 bytes Download GZ
100 MB GZ samplesample-gz-100mb.gz 100 MB104,857,600 bytes Expands to 885,429,718 bytes Download GZ

More GZ samples

Hand-designed files with realistic content or a specific edge case.

Curated GZ sample files
FileSizeContentsDownload
Sample .tar.gz archive (double extension)sample-archive.tar.gz 1.02 KB1,041 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

Software recognises a GZ file by its file signature: fixed bytes at the start of the file, also called magic bytes or a magic number.

The first bytes of every file. The third byte is the compression method; 08 means deflate.
Extension.gz
MIME typeapplication/gzip
Also seen asapplication/x-gzip
SpecificationRFC 1952
CompressionDeflate (RFC 1951)
IntegrityCRC-32 and length of the uncompressed data
Optional header fieldsOriginal file name, comment, extra data

What to test for

These are the behaviours that most often go wrong when software handles GZ files.

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.