# .webp MIME Type: image/webp

> Lossy and lossless images with transparency and animation, supported by every current browser.

- MIME type: `image/webp`
- Extensions: .webp
- Content-Type header: `image/webp`
- Compress in transit: no (already compressed)
- File signature: `52 49 46 46 xx xx xx xx 57 45 42 50`

## Good to know

- Typically 25–35% smaller than JPEG at similar quality.
- To serve WebP only to browsers that accept it, check the `Accept` header (browsers send `image/webp`) and add `Vary: Accept` — or use `<picture>` with fallbacks.

## Server configuration

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

```
image/webp webp;
```

### Apache (.htaccess or server config)

```
AddType image/webp .webp
```

### Express

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

### Python

```
import mimetypes

mimetypes.add_type("image/webp", ".webp")
```

### HTML file input

```
<input type="file" accept=".webp,image/webp">
```

## FAQ

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

`image/webp`.

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

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

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

Check its bytes rather than the extension: WEBP files start with `52 49 46 46 xx xx xx xx 57 45 42 50` (`RIFF....WEBP`). On the command line, `file --mime-type name.webp` does this for you.

## Related types

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

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