Gzip compress and decompress
Compress text with gzip to base64 and see the size saved, or decompress base64 gzip data.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/gzip \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"na na na na na na na na na na na na na na na na Batman!"}}'
import json, urllib.request
body = {'input': {'text': 'na na na na na na na na na na na na na na na na Batman!'}}
request = urllib.request.Request("https://setget.net/v1/tools/gzip", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/gzip", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"na na na na na na na na na na na na na na na na Batman!"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "gzip",
"input": {
"text": "na na na na na na na na na na na na na na na na Batman!"
}
}
{
"input": {
"text": "na na na na na na na na na na na na na na na na Batman!"
}
}
Endpoint: POST /v1/tools/gzip. Over MCP: run_tool with slug: "gzip".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The text to compress, or base64 gzip data to decompress. |
action |
string | no | Compress text, or decompress gzip data. One of: compress, decompress. Default: "compress". |
level |
integer | no | Compression effort when compressing, from 1 (fastest) to 9 (smallest). Default: 6. From 1 to 9. |
Examples
Input
{
"text": "na na na na na na na na na na na na na na na na Batman!"
}Result
{
"text": "H4sIAAAAAAAA/8tLVMgjBTklluQm5ikCANmXu+U3AAAA",
"bytes_before": 55,
"bytes_after": 33,
"ratio": 0.6
}Back to text
Input
{
"text": "H4sIAAAAAAAA/8tLVMgjBTklluQm5ikCANmXu+U3AAAA",
"action": "decompress"
}Result
{
"text": "na na na na na na na na na na na na na na na na Batman!",
"encoding": "utf-8",
"binary": false,
"bytes": 55
}Questions
- Why is the compressed result larger than my text?
- Gzip adds 18 bytes of header and checksum, and base64 adds a third on top. Compression only pays off on longer or repetitive text.
- Is there a size limit?
- Yes. Decompression stops with an error once the output passes 5 MB, which also protects against "zip bomb" data that expands enormously.
- What if the decompressed data is not text?
- Bytes that are not valid UTF-8 are returned as base64, with "binary" set to true.
Related tools
- Deflate compress and decompressCompress text to a zlib or raw deflate stream as base64, or decompress one. The format is detected.
deflate - Base64 encoder and decoderEncode text to Base64 or decode it back, in the standard or URL-safe alphabet.
base64 - CRC-32 and Adler-32 checksumCompute the CRC-32 and Adler-32 checksums of text or bytes, as decimal and hex.
crc32 - JSON minifierRemove all optional whitespace from JSON to make it as small as possible.
json-minify - All hashes at onceCompute every supported hash of one input at once: MD5, SHA-1, SHA-2, SHA3-256 and BLAKE2b.
hash-all - Base32 encoder and decoderEncode text to Base32 (RFC 4648) or decode it back, with or without padding.
base32