devkult_
tools29converters34
home/mime/.tar

.tar MIME type

Tar archivearchives

application/x-tar

Uncompressed Unix archives, usually compressed afterwards as .tar.gz or .tar.xz.

MIME typeapplication/x-tar
Extensions.tar
Content-Typeapplication/x-tar
Compress in transit?Yes — enable gzip or Brotli
File signature75 73 74 61 72 (ustar) at offset 257

Good to know

  • A plain .tar isn't compressed, so it compresses well in transit.

Serve .tar files with the right type

The response header to send:

Content-Type: application/x-tar

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
application/x-tar tar;
Apache (.htaccess or server config)
AddType application/x-tar .tar
Express
res.set("Content-Type", "application/x-tar");
Python
import mimetypes

mimetypes.add_type("application/x-tar", ".tar")
HTML file input
<input type="file" accept=".tar,application/x-tar">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.tar | grep -i '^content-type:'
file --mime-type file.tar

Frequently asked questions

What is the MIME type for .tar files?

application/x-tar.

What Content-Type header should a .tar file be served with?

Content-Type: application/x-tar. It compresses well, so let the server apply gzip or Brotli.

How can I tell if a file is really a .tar?

Check its bytes rather than the extension: TAR files contain 75 73 74 61 72 (ustar) at byte offset 257. On the command line, file --mime-type name.tar does this for you.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options