How to Check a GZIP File
A .gz file carries more than compressed bytes. Its header can hold the original name, a timestamp and the OS it was made on, and its trailer holds a checksum and the original size. This page reads all of it and tells you whether the file is intact.
Upload a .gz file or paste Base64
Upload the GZIP file you want to check, or paste it as Base64:
Example: the start of the Sample in Base64
GZIP in Base64 nearly always begins with "H4sI", the encoding of the magic bytes 1f 8b and method 8 described in RFC 1952:
H4sIAAAAAAAAA5WRT0sDMRDF7/0UQ86r7C4Wul7V7kVlsdWLlJDdna7B/ClJtlJKv7uTiBUp...Read the analysis
The check runs by itself about half a second after the input changes. Before "Valid GZIP" appears, the data has been fully decompressed and its CRC-32 and size trailer compared, so a file that only has the right first two bytes will not pass.
Example: what the Sample shows
The Sample was made without a stored name or timestamp, which is why those fields are empty. A file made with gzip on the command line usually has both.
Look at or save the content
Frequently Asked Questions
How do I check if a file is GZIP compressed?
Upload it with the "Upload" button, or paste its Base64 text. A GZIP file always starts with the bytes 1f 8b (in Base64, "H4sI"). If those are there, the page reads the whole file, decompresses it and compares the checksum before it shows "Valid GZIP". If they are not, it tells you what the data looks like instead: ZLIB, raw DEFLATE, ZIP, Zstandard, plain text and a few other formats are recognised.
What does the page read from a GZIP header?
Everything the format stores: the compression method, the flags, the modification time (shown in UTC), the XFL hint byte, the operating system byte, and, when present, the original file name, the comment, the extra field and the header checksum. From the 8-byte trailer it reads the CRC-32 and the original size, and checks both against what actually came out.
Can it tell me which compression level was used?
Not exactly, and neither can anything else. GZIP files do not store the level. There is one hint byte (XFL): 2 means the compressor used its slowest, best setting, 4 means its fastest, and 0 means no hint. Plenty of compressors write 0 whatever the level, so treat it as a hint only.
How is the compression ratio worked out?
It is 1 − (size of the GZIP data ÷ size of the original), where the original size is the number of bytes that really came out when decompressing. For the Sample, 268 bytes of GZIP hold 494 bytes of JSON, so it is 45.75% smaller. gzip -l leaves the 18 bytes of header and trailer out of its sum, so its figure can be a little different. Very small or already-compressed inputs often get bigger, and the page says so ("8.46% larger").
What do "cut off", "checksum doesn't match" and "extra bytes" mean?
Cut off means the data ends before the compressed stream or its trailer does, usually an interrupted download or a Base64 string that was not copied in full. A checksum mismatch means the bytes decompressed but do not match the CRC-32 or size stored in the file, so the content cannot be trusted. Extra bytes means something was appended after the GZIP data; gzip calls that trailing garbage. Zero bytes at the end are only padding and are accepted.
Does it handle files with several GZIP members?
Yes. Concatenated .gz files (for example cat a.gz b.gz > all.gz) are valid GZIP, and the page lists each member with its size and name. The preview and the download hold all members joined together, which is what gunzip gives you too.
Is my file uploaded anywhere?
No. The file is read and decompressed in your browser with the pako library. Nothing is sent to a server, and nothing is kept: reload the page and the editor starts empty. On the command line, gzip -t file.gz runs the same integrity test and gzip -lv file.gz prints sizes and the CRC.
Can this tool check TAR.GZ files?
It checks the GZIP layer: header, checksum, sizes and ratio. The TAR archive inside is binary, so the preview says so instead of showing garbled text, and Download saves the .tar exactly. To list and save the files inside, use the TAR.GZ Extractor.
Related Tools
GZIP Compressor
GZIP compressor online - Compress files with GZIP compression, reduce file size by up to 90%. Fast gzip compression tool
GZIP Decompressor
Open a .gz file or GZIP Base64 in your browser and get the original bytes back
GZIP Unzip
GZIP unzip tool - Unzip and extract .gz files online. Fast GZIP extractor and gunzip decompression
TAR.GZ Extractor
TAR.GZ extractor - Extract and untar .tar.gz and .tgz files online. Free TAR.GZ decompressor and archive extractor
GZIP to Base64
Compress data with GZIP and encode to Base64 format
Base64 to GZIP
Decode Base64 and decompress the GZIP data inside it