# .rar MIME Type: application/vnd.rar

> RAR archives. Registered as application/vnd.rar; older servers send application/x-rar-compressed.

- MIME type: `application/vnd.rar`
- Extensions: .rar
- Also seen as: `application/x-rar-compressed`
- Content-Type header: `application/vnd.rar`
- Compress in transit: no (already compressed)
- File signature: `52 61 72 21 1A 07`

## Good to know

- Creating RAR files requires proprietary software; prefer ZIP or 7z for distribution.

## Server configuration

### nginx (inside the types block in mime.types)

```
application/vnd.rar rar;
```

### Apache (.htaccess or server config)

```
AddType application/vnd.rar .rar
```

### Express

```
res.set("Content-Type", "application/vnd.rar");
```

### Python

```
import mimetypes

mimetypes.add_type("application/vnd.rar", ".rar")
```

### HTML file input

```
<input type="file" accept=".rar,application/vnd.rar">
```

## FAQ

### What is the MIME type for .rar files?

`application/vnd.rar`. You may also see `application/x-rar-compressed`, but `application/vnd.rar` is the one to send.

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

`Content-Type: application/vnd.rar`. It's already compressed, so servers shouldn't gzip it.

### How can I tell if a file is really a .rar?

Check its bytes rather than the extension: RAR files start with `52 61 72 21 1A 07` (`Rar!..`). On the command line, `file --mime-type name.rar` does this for you.

## Related types

- [.zip — application/zip](https://www.devkult.com/mime/zip.md)
- [.7z — application/x-7z-compressed](https://www.devkult.com/mime/7z.md)

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