Windows graphics metafile (.wmf)
.wmf file signature | image/wmf
Windows Metadata file (Win 3.x format)
Magic Bytes
Offset 0
D7 CD C6 9A
Sources: Wikipedia, Gary Kessler, Neil Harvey FileSignatures
All Known Signatures
4 signature variants are documented for .wmf files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| D7 CD C6 9A | 0 | Wikipedia, Gary Kessler, Neil Harvey FileSignatures |
| 01 00 09 00 00 03 | 0 | Apache Tika, Gary Kessler |
| D7 CD C6 9A 00 00 | 0 | Apache Tika |
| D4 C3 B2 A1 | 0 | Gary Kessler |
Extension
.wmf
MIME Type
image/wmf
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .wmf files in Python
def is_wmf(file_path: str) -> bool:
"""Check if file is a valid WMF by magic bytes."""
signature = bytes([0xD7, 0xCD, 0xC6, 0x9A])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .wmf files in Node.js
function isWMF(buffer: Buffer): boolean {
const signature = Buffer.from([0xD7, 0xCD, 0xC6, 0x9A]);
return buffer.subarray(0, 4).equals(signature);
}
How to validate .wmf files in Go
func IsWMF(data []byte) bool {
signature := []byte{0xD7, 0xCD, 0xC6, 0x9A}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
/api/v1/wmf
curl https://filesignature.org/api/v1/wmf
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .wmf file?
A .wmf file is a Windows graphics metafile file. Windows Metadata file (Win 3.x format)
What are the magic bytes for .wmf files?
The magic bytes for Windows graphics metafile files are D7 CD C6 9A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .wmf file?
To validate a .wmf file, read the first bytes of the file and compare them against the known magic bytes (D7 CD C6 9A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .wmf files?
The primary MIME type for .wmf files is image/wmf.
Is it safe to open .wmf files?
Windows graphics metafile (.wmf) 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.