Back to MIME Types

application/x-tar TAR Archive Common

Identifies TAR archives — a Unix-standard format that bundles files together without compression.

What it's for

application/x-tar identifies TAR (Tape Archive) files — a Unix-standard format for bundling multiple files and directories into a single file, notably without any compression built in. This is a key distinction from ZIP: TAR's job is purely to combine files together (preserving structure, permissions, and Unix-specific metadata), while compression is deliberately handled as a separate step, almost always by piping the result through gzip — producing the extremely common .tar.gz (or .tgz) combination.

This separation of concerns (bundling vs. compression) is a deliberate Unix philosophy choice — do one thing well — and is why you'll almost never see a bare, uncompressed .tar file in practice outside of specific contexts (like some backup or streaming workflows) where compression isn't wanted or is handled differently.

Format & syntax

Content-Type: application/x-tar

No parameters. A TAR file's internal structure is a straightforward sequential concatenation of file headers (containing metadata like permissions, ownership, and file size) followed by each file's raw content, block by block — a much simpler internal structure than ZIP's format, which is part of why it streams and pipes so naturally in Unix tooling.

How it's used in practice

  • Combined with gzip for compressed archives (.tar.gz) — by far the most common real-world usage pattern: tar bundles files, gzip compresses the result, producing the ubiquitous .tar.gz archive format seen throughout Unix/Linux software distribution, source code releases, and backups.
  • Docker image layers — Docker images are internally built from a series of TAR-formatted filesystem layers, making TAR a foundational format in modern containerization even though most developers never interact with it directly in that context.
  • Unix system backups — TAR's native preservation of Unix file permissions, ownership, and special file types (symlinks, device files) makes it a natural fit for system-level backup tooling on Unix-like systems, where those metadata details matter.
  • Software source distribution — open-source project releases are very commonly distributed as .tar.gz (or increasingly .tar.xz for better compression), the traditional Unix/Linux equivalent of a ZIP download.

Common mistakes & gotchas

  • Expecting a bare .tar file to be compressed — a plain .tar file has no compression applied at all and can actually be larger than the sum of its uncompressed source files (due to block-alignment padding); the compression comes entirely from a separate step like gzip, which is why .tar.gz (not bare .tar) is the format people usually mean when casually saying "tarball."
  • Losing Windows-specific metadata when using TAR cross-platform — TAR's metadata model is fundamentally Unix-oriented (permissions, ownership, Unix-style special files); moving archives between Unix and Windows systems can lose or misinterpret certain metadata that doesn't map cleanly between the two systems' file permission models.
  • Confusing TAR's role with ZIP's — because both are commonly thought of as "archive formats," it's easy to forget TAR by itself doesn't compress anything — always check whether you're dealing with a bare .tar (uncompressed) or a .tar.gz/.tar.xz (compressed) when reasoning about expected file sizes.
  • Not preserving symlinks/special files correctly across different TAR implementations — while TAR is a well-established format, different implementations (GNU tar, BSD tar, and others) have some format variations and extensions that can occasionally cause subtle compatibility issues with unusual file types or very long file paths.

Comparison & FAQ

Type Purpose Key difference from application/x-tar
application/gzip Compression, typically paired with TAR Handles compression only; TAR handles bundling only — together they form the common .tar.gz combination
application/zip Bundling and compression combined Does both in one format/step, unlike TAR's deliberate separation of concerns

Why isn't my .tar file smaller than the original files?

Because TAR by itself doesn't compress anything — it only bundles files together, and can even be slightly larger than the source files due to block-alignment padding. Compression comes from pairing it with gzip (.tar.gz) or another compression tool.

What's the difference between .tar and .tar.gz?

.tar is an uncompressed bundle of files; .tar.gz is that same bundle additionally compressed with gzip — the two-step "bundle then compress" pattern is TAR's deliberate design, unlike ZIP which combines both steps into one format.

Why does TAR preserve Unix file permissions but ZIP sometimes doesn't handle them as well?

TAR was designed natively around Unix filesystem semantics (permissions, ownership, symlinks), while ZIP's format has more varied, less universally consistent support for these Unix-specific metadata details across different implementations.

Is TAR relevant if I'm not doing systems/DevOps work?

You'll encounter it indirectly even in general web development — Docker images are built from TAR-formatted layers internally, and many downloaded open-source project releases and dependencies arrive as .tar.gz archives.