# .jpg MIME Type: image/jpeg

> Lossy photographic images. The type is image/jpeg for both .jpg and .jpeg.

- MIME type: `image/jpeg`
- Extensions: .jpg, .jpeg, .jpe
- Content-Type header: `image/jpeg`
- Compress in transit: no (already compressed)
- File signature: `FF D8 FF`

## Good to know

- `image/jpg` is not a registered type. Some software sends it; accept it on upload, but always serve `image/jpeg`.
- JPEG has no transparency; use PNG, WebP or AVIF if you need it.

## Server configuration

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

```
image/jpeg jpg jpeg jpe;
```

### Apache (.htaccess or server config)

```
AddType image/jpeg .jpg .jpeg .jpe
```

### Express

```
res.set("Content-Type", "image/jpeg");
```

### Python

```
import mimetypes

mimetypes.add_type("image/jpeg", ".jpg")
mimetypes.add_type("image/jpeg", ".jpeg")
mimetypes.add_type("image/jpeg", ".jpe")
```

### HTML file input

```
<input type="file" accept=".jpg,.jpeg,.jpe,image/jpeg">
```

## FAQ

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

`image/jpeg`. The same type covers .jpeg, .jpe.

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

`Content-Type: image/jpeg`. It's already compressed, so servers shouldn't gzip it.

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

Check its bytes rather than the extension: JPG files start with `FF D8 FF`. On the command line, `file --mime-type name.jpg` does this for you.

## Related types

- [.png — image/png](https://www.devkult.com/mime/png.md)
- [.webp — image/webp](https://www.devkult.com/mime/webp.md)
- [.avif — image/avif](https://www.devkult.com/mime/avif.md)
- [.heic — image/heic](https://www.devkult.com/mime/heic.md)

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