image/webp
The modern MIME type for WebP images offering superior compression for both lossy and lossless encoding.
What Is This?
The image/webp MIME type indicates that the content is a WebP image developed by Google. WebP provides superior compression compared to JPEG and PNG — lossy WebP images are 25-35% smaller than equivalent quality JPEGs, and lossless WebP images are 26% smaller than PNGs. WebP also supports transparency (alpha channel) and animation.
Common Uses
Common Use
Modern web pages optimizing for performance
Common Use
E-commerce product images with fast loading requirements
Common Use
Blog and news article images
Common Use
Replacing both JPEG and PNG with a single format
Examples
Serve files with the image/webp MIME type:
# Nginx
location ~ \.webp$ {
add_header Content-Type "image/webp";
}
# Apache
AddType image/webp .webpUse this MIME type in HTML or HTTP:
Content-Type: image/webp <!-- HTML reference --> <link rel="preload" href="file.webp" as="fetch" crossorigin>
Related Entries
More from this reference:
image/png
The MIME type for PNG (Portable Network Graphics) image files with lossless compression.
image/jpeg
The MIME type for JPEG image files using lossy compression for photographs.
image/gif
The MIME type for GIF images supporting animation and transparency.
image/svg+xml
The MIME type for SVG (Scalable Vector Graphics) vector images.
image/avif
The next-generation MIME type for AVIF images with advanced compression based on AV1 video codec.
Frequently Asked Questions
Should I use WebP for all images?
Yes, with fallbacks. Use WebP as the primary format with JPEG/PNG fallbacks via the <picture> element. This gives modern browsers better compression while maintaining compatibility.
Does WebP support animation like GIF?
Yes. WebP supports animated images with much better compression than GIF. Animated WebP files are typically 90% smaller than equivalent GIFs.