Download a sample GZ file of any size
Get a gzip file that decompresses to a plain-text sample.txt, at the exact compressed size you choose.
1 MB = 1,000,000 B · 1 MiB = 1,048,576 B
Advanced: test an upload limit
Enter the byte limit above, then choose one byte below, the exact limit or one byte above. Each choice uses the same base: 10,485,760 B. Generate and download each file to test your endpoint.
How is the sample GZ file built?
Each file is a single gzip member with the original file name sample.txt in its header. The data is written as stored (uncompressed) deflate blocks of up to 65,535 bytes, with a correct CRC-32 and length in the trailer. Stored blocks are part of the deflate format, so any gzip reader accepts them, and they let the file hit an exact size.
The smallest valid GZ file is 34 bytes; any byte count from there up to 2 GiB can be selected. MIME type: application/gzip.
Which GZ size do you need?
What is inside a 1 MiB GZ file?
The 1 MiB sample has 16 stored blocks and unpacks to 1,048,467 bytes of text, only 109 bytes more than the file's header, block headers and trailer take away. gzip -t reports no errors. Because nothing is compressed, the file is not a zip bomb.
When is a sample GZ file useful?
- Testing upload fields that accept .gz log or data dumps.
- Checking that a server decompresses gzip uploads and enforces a limit on the unpacked size.
- Testing Content-Encoding handling with a file whose compressed and unpacked sizes are almost equal.
Questions about GZ test files
Why is it not smaller than the text inside?
The data is stored, not compressed, so the exact size can be set. Re-compress it with gzip -9 to see how small the same text gets.
What file comes out?
sample.txt, a plain-text file of repeated lines.
Format reference and related tools
Format reference: RFC 1952, GZIP file format.
Other formats in this family (Archives): ZIP · BIN · TAR.
Related: ZIP test files · BIN test files · Bytes to MB converter
Noticed an issue with this test file? Report an issue →