It is also possible to decompress it using standard shell-script + gzip, if you don't have, or want to use openssl or other tools.
The trick is to prepend the gzip magic number and compress method to the actual data from zlib.compress:

printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - /tmp/data |gzip -dc >/tmp/out

Edits:
@d0sboots commented: For RAW Deflate data, you need to add 2 more null bytes:
โ†’ "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00"

This Q on SO gives more information about this approach. An answer there suggests that there is also an 8 byte footer.

Users @Vitali-Kushner and @mark-bessey reported success even with truncated files, so a gzip footer does not seem strictly required.

@tobias-kienzler suggested this function for the bashrc:
zlibd() (printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" | cat - "$@" | gzip -dc)

Answer from wkpark on Stack Exchange
๐ŸŒ
Code Beautify
codebeautify.org โ€บ zlib-decompress-online
Zlib Decompress Online to Zlib Decode Text
This tool supports loading the Zlib data File to decompress to Text. Click on the Upload button and select File. Zlib to Decompress Online works well on Windows, MAC, Linux, Chrome, Firefox, Edge, and Safari.
๐ŸŒ
OnlinePHP
onlinephp.io โ€บ zlib-decode
zlib_decode - Online Tool
# Execute and compare PHP Online ยท Sandbox ยท PHP Functions ยท Donate/Get Premium ยท Login / Register ยท Home ยท PHP Functions ยท General ยท zlib_decode ยท Execute zlib_decode with this online tool zlib_decode() - Uncompress any raw/gzip/zlib ...
Discussions

Zlib uncompression for an noob

Looks like zlib compressed data, here's more info how to deflate it: https://unix.stackexchange.com/questions/22834/how-to-uncompress-zlib-data-in-unix

More on reddit.com
๐ŸŒ r/LiveOverflow
5
6
March 27, 2020
Open a .bin file compressed by Zlib?
gunzip filename.gz See https://en.wikipedia.org/wiki/Zlib More on reddit.com
๐ŸŒ r/techsupport
2
1
July 30, 2024
decompressing a .deflate file?
If you can use PHP, maybe try gzinflate or gzuncompress See https://www.php.net/manual/en/function.gzinflate.php or https://www.php.net/manual/en/function.gzuncompress.php More on reddit.com
๐ŸŒ r/compression
3
2
April 22, 2023
Decompress zlib in with powershell
I have a zlib-compressed binary that needed to be decompress into a xml. More on reddit.com
๐ŸŒ r/PowerShell
4
4
August 31, 2019
People also ask

What is ZLib compression?
ZLib is a software library and data format used for data compression. It uses the DEFLATE algorithm and adds a small header and checksum, making it slightly different from raw DEFLATE or gzip.
๐ŸŒ
codeitbro.com
codeitbro.com โ€บ home โ€บ all tools โ€บ development tools โ€บ generators & utilities โ€บ zlib decompress online
ZLib Decompress Online โ€” Free Online Tool | CodeItBro
What's the difference between Gzip and ZLib?
Both use DEFLATE compression, but they have different headers and checksums. Gzip includes file metadata like filename and timestamp, while ZLib has a simpler structure focused on data streams.
๐ŸŒ
codeitbro.com
codeitbro.com โ€บ home โ€บ all tools โ€บ development tools โ€บ generators & utilities โ€บ zlib decompress online
ZLib Decompress Online โ€” Free Online Tool | CodeItBro
What if decompression fails?
Ensure your input is valid zlib-compressed data. If the data was compressed with gzip, use our Gzip Decompress tool instead. ZLib and Gzip are similar but not interchangeable.
๐ŸŒ
codeitbro.com
codeitbro.com โ€บ home โ€บ all tools โ€บ development tools โ€บ generators & utilities โ€บ zlib decompress online
ZLib Decompress Online โ€” Free Online Tool | CodeItBro
๐ŸŒ
DCode
dcode.fr โ€บ informatics โ€บ algorithm โ€บ compression โ€บ zlib compression
ZLIB Compression - Free Online Compressor and Decompressor
Tool for easily analyzing, compressing, and decompressing files with the ZLIB format (RFC 1950). Reduce data size for storage and web transfer with Zlib compression.
๐ŸŒ
Jsontotable
jsontotable.org โ€บ zlib-decompression
Free Online ZLIB Decompressor - Decompress & Extract .zlib Files | Inflate Tool | JSON to Table Converter
Free online ZLIB decompression tool. Decompress .zlib files instantly. Extract compressed JSON, XML, text data. Inflate ZLIB compressed data online free. Upload files or paste base64. No registration. 100% secure browser-based tool.
๐ŸŒ
Weblaro
weblaro.com โ€บ home โ€บ tools โ€บ gzip/zlib decompress online
Gzip/ZLib Decompress Online | Weblaro Tools
Decompress Gzip (.gz) or ZLib compressed data instantly with our free online tool. Just paste your compressed string to view the original uncompressed
๐ŸŒ
Toolexe
toolexe.com โ€บ home โ€บ compression โ€บ zlib decompressor
zLib Decompress - Free Online Compression Tool - Toolexe
Decompress zlib files online instantly. Free zlib decompress tool supports text, Base64, Hex formats. No uploads required. Process files securely.
Find elsewhere
๐ŸŒ
Online Mini Tools
onlineminitools.com โ€บ zlib-decompress
Zlib Decompress - Decompress Zlib Data Online
Decompress zlib-compressed data instantly. Free online zlib decompressor that extracts original content from zlib-compressed data with support for base64 input and file uploads.
๐ŸŒ
Freecodeformat
freecodeformat.com โ€บ zlib-decompress.php
Zlib Decompress Online - Convert Zlib Base64 to Text
Free online Zlib decompressor. Convert Base64 encoded Zlib strings back to text or files. Supports drag and drop, auto-conversion, and binary file handling.
๐ŸŒ
CodeItBro
codeitbro.com โ€บ home โ€บ all tools โ€บ development tools โ€บ generators & utilities โ€บ zlib decompress online
ZLib Decompress Online โ€” Free Online Tool | CodeItBro
May 13, 2026 - Paste Base64-encoded zlib data or upload a compressed file. ... The tool instantly decompresses your data using the DEFLATE algorithm.
๐ŸŒ
Webacus
app.webacus.dev โ€บ + โ€บ zlib.inflate-raw
ZLIB / INFLATE-RAW - Decompress using INFLATE RAW - Webacus
Simplify data decompression: Use our online zlib INFLATE RAW tool for fast results.
๐ŸŒ
Filext
filext.com โ€บ file-extension โ€บ ZLIB
ZLIB File Extension - What is it? How to open a ZLIB file?
These files serve to shrink data size while keeping all the original information intact. Purpose: They package data into a smaller size for efficient storage and transfer. Functionality: The internal format follows the zlib stream standard, which utilizes a deflate algorithm. Usage: Common in systems that require fast decompression ...
๐ŸŒ
OnWorks
onworks.net โ€บ home โ€บ os distributions โ€บ programs โ€บ zlib decompress online
zlib_decompress - Online in the Cloud
The zlib_decompress utility decompresses mysqlpump output that was created using ZLIB compression. zlib_decompress was added in MySQL 5.7.10. Invoke zlib_decompress like this: shell> zlib_decompress ... output_file Example: shell> mysqlpump --compress-output=ZLIB > dump.zlib shell> zlib_decompress ...
๐ŸŒ
GitHub
github.com โ€บ kevin-cantwell โ€บ zlib
GitHub - kevin-cantwell/zlib: A command-line utility for quickly compressing or decompressing zlib data. ยท GitHub
Without any arguments, zlib will compress an input stream. Use the -d flag for decompression.
Starred by 48 users
Forked by 4 users
Languages ย  Go
๐ŸŒ
OnWorks
onworks.net โ€บ home
zlib_decompress
The zlib_decompress utility decompresses mysqlpump output that was created using ZLIB compression. zlib_decompress was added in MySQL 5.7.10. Invoke zlib_decompress like this: shell> zlib_decompress ... output_file Example: shell> mysqlpump --compress-output=ZLIB > dump.zlib shell> zlib_decompress ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ zlib-decompresss-in-python
zlib.decompress(s) in Python - GeeksforGeeks
March 6, 2020 - Compressed String b'x\x9c\x0b\xc9\xc8,V\x00"w7w\x85\xc4\xd2\x92\x8c\xfc"\x1d\x85\xc4\xbc\x14\x85\xb4\xcc\xbc\xc4\x1c\x85\xca\xd4\xc4"\x85\xe2\x92\xd2\x94\xd4\xbc\x12=\x00A\xc9\x0f\x0b' Decompressed String b'This is GFG author, and final year student.' Example #2 : ... # import zlib and decompress import zlib s = b'GeeksForGeeks@12345678' # using zlib.compress(s) method t = zlib.compress(s) print("Compressed String") print(t) print("\nDecompressed String") print(zlib.decompress(t)) Output :
๐ŸŒ
Chrome Web Store
chromewebstore.google.com โ€บ detail โ€บ zlib-compressor โ€บ mbdcjgoiplkdcgabdkiegfgbphppmpjj
Zlib Compressor - Chrome Web Store
October 30, 2021 - Zlib Compressor let user compress or decompress a string quickly. The "Compress" button transforms content of upper textfield using zlib deflate and base64 encode algorithm and puts result in the lower textfield.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ zlib.html
zlib โ€” Compression compatible with gzip
For applications that require data compression, the functions in this module allow compression and decompression, using the zlib library. This is an optional module. If it is missing from your copy...