devkult_
tools29converters34
home/mime/.webp

.webp MIME type

WebP imageimages

image/webp

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

MIME typeimage/webp
Extensions.webp
Content-Typeimage/webp
Compress in transit?No — already compressed
File signature52 49 46 46 xx xx xx xx 57 45 42 50 (RIFF....WEBP)

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.

Serve .webp files with the right type

The response header to send:

Content-Type: image/webp

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

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

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.webp | grep -i '^content-type:'
file --mime-type file.webp

Frequently asked questions

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

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options