.Z

Z File

Unix compress (LZW) Compressed File
Ask a question
QUICK ANSWER

A .Z file is a single file compressed with the Unix "compress" utility (LZW algorithm, 1984) - the predecessor to gzip. On Linux or macOS, run "uncompress file.Z" or "gzip -d file.Z" in a terminal. On Windows, use free 7-Zip or PeaZip. Most .Z files you will encounter are actually .tar.Z - a tar archive then compressed - which requires one extra untar step.

Developer: Spencer Thomas et al. (BSD compress, 1984) Category: Compressed Files Open standard MIME: application/x-compress
OPENS ON Windows macOS Linux
Related: .RAR · .ZIP · .Z01 · .7Z

On this page

19k+ extensions indexed
Last reviewed Jul 3, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the Z file format?

.z is a compressed file format associated with the Unix environment, created by the compress utility in 1984. .z was for a long time the main compression standard for Unix systems. .z files are created by issuing the compress filename command; the original file is replaced in place. Decompression can be performed by using the uncompress filename.z command or via zcat. .z uses the LZW (Lempel-Ziv-Welch) algorithm - a rather simple scheme that is fast but not efficient by modern standards. Every .z stream is identified by the two-byte magic number 1F 9D; the third byte encodes the LZW bit-width flag. Because compress handles only a single file at a time, multiple files were typically bundled with tar first, producing .tar.z archives (also written .taz).

Evolution of compression methods

The .z format has been almost completely displaced by the .gz format used by gzip. .z files can be converted to .gz easily without unpacking - zcat file.z | gzip > file.gz does the job. Gzip is today the standard compression tool for Unix-like systems, while modern workflows increasingly favor .xz or .bz2 for better compression ratios.

Security & safety

RISK: LOW

The .Z format itself is passive and safe - it's just LZW-compressed data and cannot execute. As with any archive, the only risk is the CONTENTS: a .tar.Z from an untrusted source could contain scripts or executables, so scan/inspect what you extract before running anything. Because .Z is old and rare today, an unexpected one arriving by email is unusual - verify the sender. There is no password/encryption in classic compress, so .Z offers no confidentiality.

Format details

in a nutshell
FULL NAMEUnix compress (LZW) Compressed File
DEVELOPERSpencer Thomas et al. (BSD compress, 1984)since 1984 (BSD compress utility, Unix)
MIME TYPEapplication/x-compress
TYPESingle-file LZW-compressed stream (legacy Unix)
STANDARDOpen · royalty-free
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001
HEX
1F9D
ASCII
··
A classic .Z file starts with 1F 9D (the third byte encodes the LZW bit width / block-mode flag). Note: gzip's .gz uses 1F 8B - similar first byte, different second. .Z holds a SINGLE compressed stream; multiple files are usually bundled with tar first, giving .tar.Z (also seen as .taz / .tz).

Programs that open Z files

Windows4 apps
WinZip Paid Opens .Z; useful if already installed, but paid - free 7-Zip/PeaZip do the same.
WinRAR Paid Double-click to open and Extract To. Reads .Z and .tar.Z. (7-Zip is the free choice.)
7-Zip Open-source Right-click the .Z > 7-Zip > Extract Here. For .tar.Z, extract twice (once to .tar, then the .tar). Free.
PeaZip Open-source Open the .Z and Extract; free GUI archiver that handles legacy Unix formats.
macOS2 apps
The Unarchiver Free Double-click the .Z to extract via a GUI; handles .tar.Z too. Free on the Mac App Store.
Terminal (uncompress/gzip) Built-in Run 'uncompress file.Z' or 'gzip -d file.Z'; for .tar.Z use 'tar xzf file.tar.Z'.
Linux2 apps
uncompress / gzip (built-in) Open-source Run 'uncompress file.Z' or 'gzip -d file.Z'. For tarballs: 'tar xzf file.tar.Z' extracts in one step.
Ark / File Roller Open-source Default KDE/GNOME archive managers; double-click the .Z (or .tar.Z) to extract via a GUI.

Technical details

deep spec
AlgorithmLZW (Lempel-Ziv-Welch) adaptive dictionary compression
Magic bytes`1F 9D` at file offset 0
Header structure3-byte header - magic `1F 9D` plus an options byte encoding max bit-width and block-mode flag
LZW bit-width range9 to 16 bits; default maximum is 16 bits
Block modeOptional dictionary-reset mode; signalled by bit 7 (0x80) of the third header byte
MIME type`application/x-compress`
Single-file scopeEach `.z` stream compresses exactly one file; multi-file bundles require a prior `tar` step
Compound archive form`.tar.z` (also `.taz` / `.tz`) - a `tar` archive subsequently compressed with `compress`
Decompression commands`uncompress filename.z`, `zcat filename.z`, or `gzip -d filename.z`
LZW patent historyLZW was patented by Unisys/Sperry; patents expired around 2003, ending earlier licensing concerns
Magic-byte distinction from gzipBoth `.z` and `.gz` start with `1F`; second byte differs - `9D` for `.z`, `8B` for `.gz`
Compression efficiencyLower compression ratio than gzip, bzip2, or xz on typical data types
Originating utilityBSD `compress` written by Spencer Thomas et al.; replaced by gzip as the standard Unix compression tool
Windows supportNot natively supported on Windows; requires third-party tools such as 7-Zip, WinRAR, or WinZip
Released1984 (BSD compress utility, Unix)
Open standardYes · royalty-free
Specificationen.wikipedia.org

Z conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with Z files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about Z files.

Frequently asked questions

How do I open a .Z file?
On Linux/macOS run 'uncompress file.Z' or 'gzip -d file.Z' in a terminal (gzip reads the old .Z format). On Windows, use free 7-Zip or PeaZip: right-click > Extract. For .tar.Z, also untar the result.
Is a .Z file the same as a .gz or .zip file?
No. .Z is the older Unix 'compress' (LZW) format; .gz is gzip (better compression, the modern replacement); .zip is a multi-file archive built into every OS. .Z and .gz each hold a single file; ZIP holds many. gzip can decompress all three of .Z and .gz.
How do I extract a .tar.Z file?
On Linux/macOS, one command does it: 'tar xzf file.tar.Z'. Or decompress first ('uncompress file.tar.Z') then 'tar xf file.tar'. On Windows, 7-Zip extracts it in two passes (.tar.Z -> .tar -> files).
How do I open a .Z file on Windows?
Windows has no built-in support. Install free 7-Zip or PeaZip and right-click the file > Extract. WinRAR and WinZip also work if you already have them.
Why does my .Z file extract to another file with no extension?
Because .Z compresses a SINGLE file - decompressing reveals that one original file. If it was a .tar.Z, the result is a .tar archive you then need to untar to get the individual files.

References

1Wikipedia - compress (software) / LZW .Z formaten.wikipedia.org
2GNU gzip manual (reads/decompresses .Z)www.gnu.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.BINCD/DVD Disc Image (BIN/CUE)
7.NOMEDIAAndroid No-Media Marker File
8.TMPTemporary File
9.MDMarkdown Document
10.RPMSGRestricted Permission Message

Related extensions

.RARRAR Archive (Roshal ARchive)
.ZIPZIP Archive
.Z01Split ZIP Archive - First Part
.7Z7-Zip Archive
.001Split / multi-volume archive - first part (.001)
.ZIRenamed / Truncated ZIP Archive

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z