GZIP Decompressor
Decompress GZIP files and encoded data directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulGZIP Decompression - Unzip .gz Data Online in Browser
GZIP is a popular compression format used in HTTP (Content-Encoding: gzip), .gz files, .tar.gz files and server logs. The tool decompresses GZIP data directly in the browser (pako.js library / DecompressionStream API) without sending data to the server - safe for sensitive data.
GZIP and DEFLATE - basics
GZIP: file format (.gz) based on the DEFLATE algorithm (LZ77 + Huffman coding). Header: magic bytes 1f 8b (hex). Compression of typical text data: 60-80% reduction. DEFLATE: core algorithm (without gzip header). zlib: DEFLATE with zlib header. Brotli: newer algorithm (br), better compression than gzip, supported by modern browsers.
GZIP in HTTP
Server response: Content-Encoding: gzip (browser decompresses automatically). Client request: Accept-Encoding: gzip, deflate, br. Transfer-Encoding: chunked + gzip. Verification: curl -I -H "Accept-Encoding: gzip" URL → search Content-Encoding: gzip. Savings: HTML 70%, JSON API 60-80%, CSS/JS 50-70%. GZIP is default on Apache (mod_deflate), Nginx (gzip on).
Online decompression use cases
API responses: server returns compressed JSON - tool decompresses to readable text. Server logs: .gz Apache/Nginx log archives for quick viewing. Databases: PostgreSQL/MySQL exports in .tar.gz. S3/GCS: .gz files from storage objects. Kafka/Kinesis: messages gzip compressed (base64 encoded in some tools).
GZIP Terminal Commands
File decompression: gunzip file.gz or gzip -d file.gz. Preview without decompression: zcat file.gz | head. Compression: gzip file or gzip -9 file (max compression). TAR + GZIP: tar -xzf archive.tar.gz. List the contents: tar -tzf archive.tar.gz. Pipe: curl URL | gunzip | greppattern. Python: import gzip; gzip.decompress(data).
FAQ
What is the difference between GZIP, ZIP and 7z?
GZIP (.gz): compresses one file. Often with TAR (.tar.gz = tarball). HTTP standard. ZIP (.zip): multi-file archive, per-file compression (DEFLATE or Store). Works cross-platform without additional tools (Windows, macOS). 7z (.7z): LZMA2 algorithm, better compression than zip/gzip. Brotli (.br): HTTP-only, not an archive file. Zstandard (zstd): modern, faster than gzip.
How to check if a file is a valid GZIP?
Magic bytes: first 2 bytes = 1F 8B (hex). Terminal: file file.gz → "gzip compressed data". hexdump: hexdump -C file.gz | head -1 → check 1f 8b. Python: import gzip; gzip.open(path).read(). If the .gz file does not open: it may be truncated, corrupted or not a real GZIP.
How to compress JSON API in Node.js?
Express.js: npm install compression, app.use(compression()). Fastify: fastify-compress. Manually: const zlib = require("zlib"); zlib.gzip(Buffer.from(json), callback). Stream: fs.createReadStream().pipe(zlib.createGzip()).pipe(res). AWS Lambda: auto-compressed response with isBase64Encoded=true + Content-Encoding: gzip.
Why shouldn't GZIP be used for binary files?
JPEG, PNG, MP4, MP3: already compressed - gzip gives no profit or enlarges the file. PDF: partially compressed - minimal gain. AES encrypted data: random – gzip does not compress. Rule: gzip only works for data with repeating patterns (text, JSON, HTML, XML, SVG).
How to debug "Content-Encoding: gzip" error in fetch?
fetch() automatically decompresses gzip. Problem: duplicate compression (proxy + server = double gzip). Check: response.headers.get("Content-Encoding"). Curl without decompression: curl --compressed false or --no-compressed. Wireshark/Charles Proxy: preview raw bytes. DevTools Network: response body is always decompressed by the browser.
Related tools: base64 encoder, JSON formatting and HTTP development tools.