# .tar MIME Type: application/x-tar

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

- MIME type: `application/x-tar`
- Extensions: .tar
- Content-Type header: `application/x-tar`
- Compress in transit: yes
- File signature: `75 73 74 61 72` at offset 257

## Good to know

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

## Server configuration

### 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">
```

## FAQ

### 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

- [.gz — application/gzip](https://www.devkult.com/mime/gz.md)
- [.zip — application/zip](https://www.devkult.com/mime/zip.md)

Open the interactive page: https://www.devkult.com/mime/tar