# .jar MIME Type: application/java-archive

> Java libraries and applications, packaged as ZIP archives.

- MIME type: `application/java-archive`
- Extensions: .jar
- Content-Type header: `application/java-archive`
- Compress in transit: no (already compressed)
- File signature: `50 4B 03 04` (the ZIP signature — this format is a ZIP archive inside)

## Good to know

- Web and enterprise variants use `.war` and `.ear` with the same structure.

## Server configuration

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

```
application/java-archive jar;
```

### Apache (.htaccess or server config)

```
AddType application/java-archive .jar
```

### Express

```
res.set("Content-Type", "application/java-archive");
```

### Python

```
import mimetypes

mimetypes.add_type("application/java-archive", ".jar")
```

### HTML file input

```
<input type="file" accept=".jar,application/java-archive">
```

## FAQ

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

`application/java-archive`.

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

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

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

Check its bytes rather than the extension: JAR files start with `50 4B 03 04` (`PK..`) — the ZIP signature — this format is a ZIP archive inside. On the command line, `file --mime-type name.jar` does this for you.

## Related types

- [.zip — application/zip](https://www.devkult.com/mime/zip.md)
- [.apk — application/vnd.android.package-archive](https://www.devkult.com/mime/apk.md)

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