The short answer
- Gzip is a lossless compressed-data format that stores arbitrary data as one or more sequential members, without random access or full filesystem metadata.
- Open a GZ or GZIP file with a gzip-compatible decompressor such as GNU gzip. On Windows, choose a compatible local archive utility and extract the payload. On macOS, use a compatible graphical utility or GNU gzip. On a phone, select a gzip-capable file app and extract rather than trying to preview the compressed bytes. A conforming decompressor checks the 1F 8B identification bytes and compression method, skips supported optional fields, processes every member sequentially, and should validate CRC-32 when integrity matters. Gzip does not provide direct seeking to arbitrary positions in the uncompressed data.
- Treat an unfamiliar GZIP file as untrusted. CRC-32 can detect accidental corruption, but it does not establish that the payload is trustworthy. Gzip can contain arbitrary binary data, including hostile executable code, while malformed headers may contain arbitrary flag and length-like values. Use defensive parsing, validate the checksum when required, and never execute an extracted payload automatically.
Gzip Compressed Data (.gz and .gzip)
Gzip was designed by Jean-Loup Gailly and Mark Adler for compressed-data interchange across CPU types, operating systems, file systems, and character sets. It conventionally uses DEFLATE. Each member has a header, optional extra, name, and comment fields, compressed blocks, and a trailer containing CRC-32 and the uncompressed size modulo 2^32. Its identification bytes are 1F 8B and its registered MIME type is application/gzip.
To convert GZIP to another archive format, first decompress its members and then create the target archive from the recovered bytes. The gzip compression stage is lossless, but conversion cannot restore metadata the format never stored: gzip has no representation for protection or ownership attributes, and its original filename omits directories and may be normalized to lowercase.
How to open it
Open a GZ or GZIP file with a gzip-compatible decompressor such as GNU gzip. On Windows, choose a compatible local archive utility and extract the payload. On macOS, use a compatible graphical utility or GNU gzip. On a phone, select a gzip-capable file app and extract rather than trying to preview the compressed bytes. A conforming decompressor checks the 1F 8B identification bytes and compression method, skips supported optional fields, processes every member sequentially, and should validate CRC-32 when integrity matters. Gzip does not provide direct seeking to arbitrary positions in the uncompressed data.
Open a GZ or GZIP file with a gzip-compatible decompressor such as GNU gzip. On Windows, choose a compatible local archive utility and extract the payload. On macOS, use a compatible graphical utility or GNU gzip. On a phone, select a gzip-capable file app and extract rather than trying to preview the compressed bytes. A conforming decompressor checks the 1F 8B identification bytes and compression method, skips supported optional fields, processes every member sequentially, and should validate CRC-32 when integrity matters. Gzip does not provide direct seeking to arbitrary positions in the uncompressed data.
To convert GZIP to another archive format, first decompress its members and then create the target archive from the recovered bytes. The gzip compression stage is lossless, but conversion cannot restore metadata the format never stored: gzip has no representation for protection or ownership attributes, and its original filename omits directories and may be normalized to lowercase.
File safety
Treat an unfamiliar GZIP file as untrusted. CRC-32 can detect accidental corruption, but it does not establish that the payload is trustworthy. Gzip can contain arbitrary binary data, including hostile executable code, while malformed headers may contain arbitrary flag and length-like values. Use defensive parsing, validate the checksum when required, and never execute an extracted payload automatically.
An unknown sender, a name ending in two extensions, or contents that do not match the extension — check before you open it.
Converting it
To convert GZIP to another archive format, first decompress its members and then create the target archive from the recovered bytes. The gzip compression stage is lossless, but conversion cannot restore metadata the format never stored: gzip has no representation for protection or ownership attributes, and its original filename omits directories and may be normalized to lowercase.
Convert a copy, never the original, then compare quality, metadata, and layout against what you started with.
Common questions
What is a GZIP file and what is it used for?
A GZIP file is lossless compressed data intended for interchange across different computer and storage environments. It conventionally uses DEFLATE and may contain one or more sequential compressed members.
How do I open and extract a GZ file?
Use a gzip-compatible decompressor such as GNU gzip. The decompressor should recognize the 1F 8B bytes, check the compression method, skip optional header fields, and process all members in sequence.
How do I open a GZIP file on Windows?
Select a local Windows archive utility that explicitly supports gzip, then extract the payload. If integrity matters, enable or verify CRC-32 checking and do not automatically run the extracted file.
How do I open a GZ file on macOS?
Use a gzip-compatible graphical utility or GNU gzip on macOS and extract the member data. Gzip is stream-oriented, so the software normally decompresses sequentially instead of seeking through the output.
How do I extract a GZIP file on a phone?
Choose a mobile file app that explicitly supports gzip and use its extract action. Treat the resulting payload according to its own file type, and do not execute an unfamiliar extracted file automatically.
Why will my GZIP file not open or why is it reported as corrupted?
Check whether the file begins with hexadecimal 1F 8B and uses a supported compression method. A failed CRC-32 check, truncated member, malformed optional field, or damaged compressed block can indicate corruption; severe compressed-data damage may be difficult to repair.
What is the difference between the .gz and .gzip extensions, and which should I use?
Both suffixes are used for gzip compressed data, but RFC 6713 registers gz as the file extension. Use .gz when you need the registered extension or follow the receiving system's naming convention; the internal gzip structure is identified by 1F 8B, not by the suffix alone.
How do I convert GZIP to ZIP, and what can be lost?
Decompress the gzip members and create the target archive from the recovered bytes. The bytes survive gzip decompression losslessly, but ownership, protection attributes, directory components from the original filename, and filename case changes cannot necessarily be recovered from gzip.
Is an emailed or downloaded GZIP file safe to extract?
Not necessarily. CRC-32 detects some accidental corruption but does not prove safety, and gzip can wrap arbitrary binary data, including hostile executable code. Parse untrusted files defensively and never run extracted content automatically.
Can a GZIP file contain multiple members and support random access?
It can contain one or more members in sequence. Gzip provides no random access to arbitrary uncompressed positions, so software generally processes those members as streams.
Can I inspect a GZIP file without uploading it?
Yes. Use a local gzip-compatible utility to read the header or extract the members on your device; local handling avoids sending the file to a remote service.
Does a valid GZIP header and CRC-32 prove that the extracted data is trustworthy?
No. The 1F 8B header identifies the format and CRC-32 helps detect accidental corruption, but neither establishes the origin, intent, or safety of the payload.
Related formats
Sources
RFC 1952: GZIP File Format Specification Version 4.3 · RFC Editor / IETF publication
RFC 6713: The application/zlib and application/gzip Media Types · RFC Editor / IETF publication
IANA Media Types Registry · Internet Assigned Numbers Authority