Unix Compress MIME Type

Learn what application/x-compress means, how to identify and decompress Unix Compress data, and how Poly handles .Z files.

MIME type details for application/x-compress

In active use
MIME typeapplication/x-compress
Extensions
.Z.taZ
Magic number1F 9D
First standardized1984
Created bySpencer W. Thomas
Browser supportNo native file preview
Example applicationsncompress, GNU gzip, GNU tar
Poly supportPartial. Poly defines application/x-compress as an archive type, and its client recognizes .Z case-insensitively, but server-side filename inference currently misses .Z because of a case mismatch. The .taZ shorthand is not mapped, and Poly does not decompress the data.
Indexed by PolyPartial. Poly indexes the file's name and ordinary file properties, but not the compressed payload or any tar members.
Preview in PolyNo. Poly has no in-app Unix Compress decompressor or archive browser; download the file and open it with a compatible utility.
Poly agentNo. The Poly agent cannot read or reason about content inside a Unix Compress stream.

What does application/x-compress mean?

The application/x-compress media type is a historical label for data produced by the Unix compress utility. The format uses adaptive Lempel-Ziv-Welch coding and normally has an uppercase .Z suffix.12

This media type is a deployed convention rather than an IANA registration. The current IANA application registry does not list application/x-compress.3 The x- spelling remains common in software and server configurations because it has been used for decades.

A .Z file is one compressed byte stream, not a multi-file archive. A name such as source.tar.Z normally means that a TAR archive was compressed as one Unix Compress stream.

Where did Unix Compress come from?

Spencer W. Thomas released the first compress implementation in July 1984, shortly after Terry Welch published the LZW technique it used. Joseph M. Orost then produced portable updates, and version 4.0 entered the BSD lineage in 1985.4 The format became a familiar way to save space on Unix systems.

Patent concerns later made the format awkward to distribute and helped motivate alternatives. GNU Gzip was designed as a replacement using the unpatented DEFLATE method, and modern GNU tar now supports traditional Compress mainly for backward compatibility.56

Unix Compress is still meaningful when recovering old software distributions, Usenet-era collections, or backups. For new data, Gzip, XZ, Zstandard, or another actively specified format is usually a better interoperability choice.

How do you identify a .Z file?

A current Compress stream begins with 1F 9D in hexadecimal. The ncompress source defines those as the first and second magic bytes. The next byte records format flags and the maximum code width, which is commonly between 9 and 16 bits.7

1F 9D xx ...

The magic number is a useful first check, but it does not validate the complete stream. Unlike Gzip, the Compress format has no CRC covering the uncompressed data. GNU gzip can sometimes detect a damaged .Z input, but its manual warns that successful processing by a traditional uncompress implementation does not prove the file is correct.5

To test without keeping output, decode into the null device:

gzip -cd download.Z > /dev/null

That catches decoder errors, not every possible silent corruption. Keep a checksum or authenticated manifest alongside important legacy files when one is available.

How do you open an application/x-compress file?

Web browsers do not provide a native Unix Compress file viewer. A response labeled application/x-compress is normally saved and opened with a local command-line or archive utility.

The maintained ncompress implementation provides compress, uncompress, and zcat. To keep the input and choose the output name explicitly:

uncompress -kc report.txt.Z > report.txt

GNU gzip can also decode traditional .Z files:

gzip -cd report.txt.Z > report.txt

For a compressed TAR archive, inspect the members before extraction:

tar -tf source.tar.Z
tar -xf source.tar.Z -C empty-directory

GNU tar recognizes the Compress signature and can fall back to Gzip when the compress program is unavailable.6

Do not assume that lowercase .z means the same format. Case-sensitive Unix naming conventions use uppercase .Z for Compress, while lowercase .z has been used by other tools and formats.

Support in Poly

Poly has a dedicated application/x-compress identifier and classifies it as an archive. The web client maps a final .Z or .z suffix to that identifier because it normalizes extensions to lowercase.

There is an important limitation in the current server-side path. Its filename inference lowercases the entire name, then compares the result with an uppercase Z entry. That comparison cannot match. A MIME type supplied explicitly can still resolve to Poly's Unix Compress archive identifier, but server-side filename-only ingestion may leave a .Z file as generic binary data. Poly does not map the .taZ shorthand in either filename path.

Regardless of how the type is assigned, Poly treats the compressed bytes as opaque:

  • It does not decompress the stream or inspect a TAR archive inside it.
  • It does not index decompressed text, member names, or member metadata.
  • It does not generate a thumbnail or provide an in-app archive browser.
  • The Poly agent cannot read or reason about the compressed payload.

Download and decompress the file with a trusted local utility when you need its contents. Uploading the decompressed result separately lets Poly apply the preview and indexing pipeline for that file's actual format.

Is application/x-compress an HTTP content encoding?

Not by itself. Content-Type: application/x-compress describes the representation as a stored Compress stream. Content-Encoding: compress says that a representation of some other media type was transformed with the Compress coding for transfer or storage.

HTTP still defines compress as an adaptive LZW content coding and says recipients should treat x-compress as equivalent.2 Apache can therefore associate .Z with the x-compress content encoding instead of assigning it a media type.8

HeaderWhat it describesExample meaning
Content-Type: application/x-compressThe media format of the delivered bytesDownload this as a Unix Compress file
Content-Encoding: compressA reversible transformation applied to another representationDecode Compress, then interpret the declared content type

Check both headers when diagnosing a download. Treating a content encoding as a media type can leave the application with compressed bytes, while decoding a file that was meant to be saved can discard the exact original representation.

.Z, .tar.Z, and .taZ

The suffix tells you how many layers to expect:

FilenameFirst decompression resultMultiple members?
notes.txt.Znotes.txtNo
backup.tar.Zbackup.tarThe resulting TAR archive does
backup.taZA TAR archiveThe resulting TAR archive does

GNU tar recognizes .Z and .taZ as Compress suffixes.6 The spelling .taz is historically ambiguous. GNU gzip recognizes it as shorthand for .tar.Z, while current GNU tar associates lowercase .taz with Gzip. Inspect the magic bytes instead of trusting that suffix alone.56

To convert a .tar.Z package to a modern format, decompress it to TAR and then recompress that stream. To convert a plain .Z, first recover its one payload and identify what that payload actually is. Renaming the file changes neither its compression algorithm nor its contents.

Safety and compatibility considerations

Compressed data can expand far beyond its stored size. Apply output-size, memory, and time limits when processing an untrusted .Z file. If the result is a TAR archive, list its members before extraction and watch for absolute paths, parent-directory references, symbolic links, and unexpected executable files.

Decoder compatibility can also depend on the maximum code width stored in the header. The current ncompress documentation notes that data created with wider codes may not be readable on older or memory-constrained implementations.1 When targeting historical systems, a lower -b value may be necessary.

Because the format has no built-in checksum of the original bytes, archive provenance matters. Prefer a trusted source, verify an external digest when possible, and do not treat successful decompression as proof that the output is authentic or harmless.

Footnotes

  1. ncompress project. compress Manual Page. The maintained manual documents adaptive LZW coding, the .Z suffix, code widths, decompression commands, and compatibility limitations. 2
  2. Internet Engineering Task Force. RFC 9110: HTTP Semantics, Compress Coding. The standard defines compress as an adaptive LZW content coding and treats x-compress as equivalent. 2
  3. Internet Assigned Numbers Authority. Media Types Registry. The current application registry does not contain application/x-compress.
  4. ncompress project. ncompress History. The project history records the first 1984 release by Spencer W. Thomas, Joseph M. Orost's portable releases, and later BSD adoption.
  5. Free Software Foundation. GNU Gzip Manual. The manual documents .Z decoding, .taz handling, replacement of patented Compress, and the format's lack of a consistency check. 2 3
  6. Free Software Foundation. GNU tar: Creating and Reading Compressed Archives. The manual documents traditional Compress support, signature detection, decompressor fallback, and recognized suffixes. 2 3 4
  7. ncompress project. compress.c. The reference implementation defines the 1F 9D magic bytes, header flag bits, and initial 9-bit code width.
  8. Apache Software Foundation. Apache mod_mime. The module documentation shows .Z mapped to the x-compress HTTP content encoding.
© Poly Corp. 2026