Gzip Decompressor & Compressor

Decompress Base64 gzip or hex gzip data back to readable text, or compress text into Base64 gzip. Shows size comparison. Everything runs in your browser — nothing is uploaded.

Compress & Decompress Base64 Encoding Client-Side Processing

How to Use Gzip Decoder

1

Choose Mode

Select Compress (text to gzip) or Decompress (gzip to text) mode.

2

Enter Input

Paste Base64-encoded gzip data or plain text depending on the mode.

3

Convert & Review

Click Convert and check the size comparison and output.

What is Gzip?

Gzip is a file format and software application for compression and decompression. It uses the DEFLATE algorithm, which combines LZ77 and Huffman coding. Gzip is widely used for reducing file sizes in web servers, data transfer, and file archiving.

Common Uses

Web Compression

HTTP servers compress responses to reduce transfer size

File Archiving

Creating .gz compressed archives of files

API Payloads

Compressing large JSON or text payloads in APIs

Why Base64 + Gzip Together?

Raw gzip data is binary — it cannot be stored or transmitted in places that only accept text. Base64 encodes the compressed bytes into safe ASCII characters, which is why "Base64-encoded gzip" shows up everywhere in modern systems:

Cloud error payloads

S3 and other cloud services return gzipped error bodies as Base64 in JSON

Serverless & queue messages

Lambda payloads and SQS/Kafka messages are compressed then Base64-encoded to stay text-safe

HTTP & API bodies

Large JSON payloads compressed with Content-Encoding: gzip and carried as Base64 in text fields

Logs & webhooks

Compressed log batches and webhook payloads shipped as Base64 strings

This tool handles the combination in one step: paste the Base64 string, and it decodes Base64 and decompresses gzip back to readable text. Hex-encoded gzip bytes (like 1f 8b 08) are also accepted.

Frequently Asked Questions

Why is the Base64 output larger than the input?

When compressing already-small or highly random data, Gzip compression may not reduce size, and Base64 encoding adds ~33% overhead. This tool shows the size comparison so you can evaluate the benefit.

What is the maximum input size?

This tool processes data entirely in your browser. Very large inputs (several MB) may work but could slow down your browser. For production compression of large files, use server-side tools.

Is this the same as .zip files?

No. Gzip compresses a single stream or file. The .zip format is an archive format that can contain multiple files with individual compression. Gzip is simpler and often used for single-file compression and HTTP content encoding.

How do I decode Base64-encoded gzip data?

Paste the Base64 string into the input box with Decompress mode selected. The tool first decodes Base64 back to binary gzip bytes, then decompresses them with the DEFLATE algorithm and shows the readable text. No manual two-step decoding is needed.

What is the difference between Gzip, Deflate, and Zlib?

All three use the same DEFLATE compression algorithm but wrap it differently. Zlib adds a small header and checksum around the raw deflate stream. Gzip wraps deflate in a file format with a header, timestamp, and CRC32 checksum. In HTTP Content-Encoding, "gzip" is the standard value even though the payload is usually just a gzip-wrapped deflate stream.

How do I compress or decompress .gz files from the command line?

gzip file.txt compresses to file.txt.gz and deletes the original; -k keeps it. Decompress with gunzip file.txt.gz or gzip -d. For many files at once, tar czf archive.tar.gz dir/ bundles and compresses in one step, and tar xf unpacks. zcat streams a .gz file without writing anything - handy for compressed logs.

Which compression level should I use?

zlib exposes levels 1-9: 1 is fastest with the largest output, 9 squeezes hardest and slowest, and 6 is the default near the sweet spot for text. Levels 7-9 usually win only single-digit percentages over 6 while taking noticeably longer. For web responses, CPU time often matters more than the last 5% of size.

Is gzip still relevant next to Brotli and zstd?

Very. gzip (RFC 1952) is the universal fallback - every HTTP client, server, and package format speaks it - while Brotli typically compresses web text 15-20% smaller at similar speed using a built-in dictionary, and zstd wins on compression and decompression speed at high ratios. HTTP content negotiation picks the best mutually-supported encoding; .tar.gz remains the cross-platform archive default.

{-- * External Resources Component(#18 Phase 3b 内容佐证工程) * 工具页「权威引用」区块:RFC / W3C / WHATWG / ECMA / IANA / 官方规范站 / Wikipedia。 * * - 接受 :slug 属性 → 经 config/tool-sources.php 家族矩阵渲染该工具的权威引用 * - slug 未命中映射时不渲染(无权威来源的工具静默跳过) * - 链接 title 保持英文(引用源专名);description 经 * common.resources.descriptions.{key} 本地化,lang 未命中回退英文(线上不裸奔) * - 链接保持 dofollow(rel="noopener noreferrer") * * @param string|null $slug --}}