file in abyss
Back to formats

Archive

GZ GZIP Compressed Data

GZIP Compressed Data is a archive format commonly identified by .gz, .gzip. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .gz, .gzip
MIME application/gzip

Magic numbers

Analyze your file
offset 0 GZIP Compressed Data leading signature
1F 8B 08
...

Structure

  1. Header
  2. Optional metadata fields
  3. Compressed deflate blocks
  4. CRC32
  5. Input size

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 1F 8B 08, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("1f8b08")
OFFSET = 0

def is_gz(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

GZIP Compressed Data is used for compression, extraction, backups, attachments, and multi-file inspection. Validate paths, file counts, compressed size, and extracted size before unpacking.

Common detection mistakes

  • The .gz / .gzip extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • GZIP Compressed Data can start with signatures such as 1F 8B 08, but related containers and damaged files may require additional validation.

Security notes

Archives can contain zip-slip paths, excessive expansion, hidden files, and double extensions. Normalize extraction paths and enforce file count and size limits.

Using samples

11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Arc

Small GZIP

Small GZIP is a GZIP Compressed Data sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

small.txt.gz
Type Sample
Small file
34 B
Generated CC0 1.0
SHA-256 caae4369709742dd5d2661229815ec5e9c7876593ab930fe2362e10d3398cf3a
Download
Arc

Empty GZIP

Empty GZIP is a GZIP Compressed Data sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

empty.gz
Type Sample
Small file
20 B
Generated CC0 1.0
SHA-256 abfbb86f9f5ddfbd9fc1a72c43ab384702ce8bae86b60f3324748485e235e61e
Download
Arc

Blue Sky TXT.GZ

Blue Sky TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.txt.gz
Type Sample
Small file
158 B
SHA-256 bd339e2f6ecde312ad681f2dbadacb5fa40f1272a989a46e48b6ae5412d3a86b
Download
Arc

Flower Garden TXT.GZ

Flower Garden TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.txt.gz
Type Sample
Small file
192 B
SHA-256 e347f058c65e3a70b8ebd7eec0df68eb345f88f13d96ff61c5ad4a6a0d3e3c14
Download
Arc

Navy Blue Sky TXT.GZ

Navy Blue Sky TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.txt.gz
Type Sample
Small file
184 B
SHA-256 f0ffbb194ac00c32c155e2ae64f5b11125fd4ade8bf8405f9cc2df876936eb66
Download
Arc

Nature of the Sky TXT.GZ

Nature of the Sky TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.txt.gz
Type Sample
Small file
178 B
SHA-256 26c4f012b0eb40487581dbbf95c2c6629a32b6a21aa83d47f2124794a548beb2
Download
Arc

Sky Landscape TXT.GZ

Sky Landscape TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.txt.gz
Type Sample
Small file
197 B
SHA-256 6e7bb216870b8130a07481215de2dc4f3e442b2a1bc94254e3acfbbf86fef4ba
Download
Arc

Starry Sky TXT.GZ

Starry Sky TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.txt.gz
Type Sample
Small file
179 B
SHA-256 5def2c45c82871e416c64efa4e58e1367bb3b22fac3f882b0cad04eb5c83fce6
Download
Arc

Blue Night Sky TXT.GZ

Blue Night Sky TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.txt.gz
Type Sample
Small file
181 B
SHA-256 e944abd9432452504192795441c70d4d411d2fb2d157704957a6e435e9f4d6d0
Download
Arc

Hibiscus Flower TXT.GZ

Hibiscus Flower TXT.GZ is a GZIP Compressed Data sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.txt.gz
Type Sample
Small file
204 B
SHA-256 e8d823308dd8f6c889030ff57aa5990f981864988e88b76436b08dc084bec84d
Download
Arc

NASA Blue Marble TXT.GZ

NASA Blue Marble TXT.GZ is a GZIP Compressed Data sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.txt.gz
Type Sample
Small file
235 B
SHA-256 4a3d9989895a7d7cfb77d26c5369c6d539ad763fa942f4f3c16ee79910dfe7d1
Download

Frequently asked questions

What is the magic number (file signature) of GZIP Compressed Data?

GZIP Compressed Data files begin with the byte signature 1F 8B 08 ("..."). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of GZIP Compressed Data?

The MIME type for GZIP Compressed Data is application/gzip.

What file extension does GZIP Compressed Data use?

GZIP Compressed Data files use the .gz, .gzip extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats