GoogleWebP image file (.webp)
.webp file signature | image/webp
WebP is an image file format developed and maintained by Google for efficient storage of still and animated images. It is used on the web, in browsers, content management systems, and image editing tools to deliver photographs, graphics, and animations. The format is generally safe, though like other media files it should be obtained from trusted sources; support has expanded over time across major platforms and applications.
Magic Bytes
Offset 0
57 45 42 50
Sources: Wikipedia, Neil Harvey FileSignatures
All Known Signatures
4 signature variants are documented for .webp files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 57 45 42 50 | 0 | Wikipedia, Neil Harvey FileSignatures |
| 52 49 46 46 2E 2E 2E 2E 57 45 42 50 | 0 | Apache Tika |
| 52 49 46 46 | 0 | Wikipedia |
| 52 49 46 46 57 45 42 50 | 0 | Gary Kessler |
Extension
.webp
MIME Type
image/webp
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .webp files in Python
def is_webp(file_path: str) -> bool:
"""Check if file is a valid WEBP by magic bytes."""
signature = bytes([0x57, 0x45, 0x42, 0x50])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .webp files in Node.js
function isWEBP(buffer: Buffer): boolean {
const signature = Buffer.from([0x57, 0x45, 0x42, 0x50]);
return buffer.subarray(0, 4).equals(signature);
}
How to validate .webp files in Go
func IsWEBP(data []byte) bool {
signature := []byte{0x57, 0x45, 0x42, 0x50}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
/api/v1/webp
curl https://filesignature.org/api/v1/webp
See the full API documentation for all endpoints and parameters.
Related Formats
Frequently Asked Questions
What is a .webp file?
A .webp file is a GoogleWebP image file file. WebP is an image file format developed and maintained by Google for efficient storage of still and animated images. It is used on the web, in browsers, content management systems, and image editing tools to deliver photographs, graphics, and animations. The format is generally safe, though like other media files it should be obtained from trusted sources; support has expanded over time across major platforms and applications.
What are the magic bytes for .webp files?
The magic bytes for GoogleWebP image file files are 57 45 42 50 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .webp file?
To validate a .webp file, read the first bytes of the file and compare them against the known magic bytes (57 45 42 50) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .webp files?
The primary MIME type for .webp files is image/webp.
Is it safe to open .webp files?
GoogleWebP image file (.webp) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.