WEBPery

WebP uses the image/webp MIME type and .webp extension, registered in RFC 9649. How to serve, detect, and configure WebP correctly.

WebP Media Type: image/webp and RFC 9649

WebP uses the MIME type image/webp and the file extension .webp. The media type was formally registered with IANA through RFC 9649 in November 2024, fourteen years after the format's release. Serving the correct MIME type is what makes browsers render WebP rather than download it. This guide covers the media type, the standard, and correct server configuration.

For the format overview, see What is WebP?. For the byte-level detail behind detection, see WebP File Structure: RIFF Container and Chunk Format.

What is the MIME type for WebP?

The MIME type for WebP is image/webp. Servers send this value in the HTTP Content-Type response header so browsers know the bytes are a WebP image. Without the correct type, a browser may download the file instead of displaying it.

The image/webp type also appears in the browser's HTTP Accept request header. Browsers that support WebP advertise it there, which lets servers and CDNs decide whether to send WebP or a fallback format.

What is the file extension for WebP?

The file extension for WebP is .webp. The extension is a convention for humans and file systems; browsers identify the format from the MIME type and the file's leading bytes, not the extension. A correctly served WebP renders even if renamed.

Keep the .webp extension on stored files for clarity and tooling compatibility. Use the MIME type, not the extension, for runtime format decisions.

What is RFC 9649?

RFC 9649 is the formal specification of the WebP image format, published by the IETF in November 2024. It defines the file format, the RIFF container layout, the chunk types, and registers the image/webp media type with IANA. It turned WebP from a Google specification into an internet standard.

Before RFC 9649, WebP was defined only by Google's developer documentation and the libwebp reference implementation. The RFC gives the format a stable, citable standard that decoders and archivists can rely on.

How does a server detect a WebP file?

A server or library detects WebP by reading the file's first 12 bytes: RIFF, a 4-byte size, then WEBP. This magic-number check identifies the format regardless of extension or MIME configuration. Content-detection libraries use exactly this signature.

The signature is reliable because RIFF mandates it at a fixed offset. The byte layout is described in WebP File Structure: RIFF Container and Chunk Format.

How do you configure a server to serve WebP?

Configure the server to send Content-Type: image/webp for .webp files. Most modern web servers already map the extension correctly, but older configurations may need an explicit MIME mapping added.

Add the mapping per server:

  • Nginx — add image/webp webp; to the types block in mime.types.
  • Apache — add AddType image/webp .webp to the configuration or .htaccess.
  • CDNs — most detect and set image/webp automatically; verify the response header.

After configuring, confirm the Content-Type header with your browser's network inspector or a curl -I request.

Why does the correct MIME type matter?

The correct MIME type matters because browsers route bytes by type, not extension. A WebP served as application/octet-stream triggers a download instead of rendering inline. A WebP served as image/jpeg may fail to decode in strict browsers.

Correct typing also enables content negotiation: a CDN reads the Accept: image/webp request header and serves WebP to supporting browsers and a fallback to others. See WebP Browser Support.

Where to go from here

The image/webp media type and RFC 9649 give WebP a formal standard and a reliable serving contract. Configure the MIME type correctly and every modern browser renders WebP inline.

What is WebP? A Complete Guide to the WebP Image Format

WebP is Google's image format with lossy and lossless compression. Learn how it works, browser support, file sizes, transparency, and animation.

WebP Transparency: Alpha Channel Support

WebP supports an 8-bit alpha channel in lossy and lossless modes. How transparency is stored, the ALPH chunk, file-size cost, and PNG comparison.

srcset and WebP: Responsive Images with Format Fallback

Use srcset and sizes to serve responsive WebP at the right resolution per device, with a JPEG fallback. Width and density descriptors explained.

WebP File Structure: RIFF Container and Chunk Format

How a WebP file is structured: the RIFF container, the WEBP FourCC, and VP8, VP8L, VP8X, ALPH, ANIM and ANMF chunks. The byte layout explained clearly.