What is the WMF file format?
.wmf is a vector image file developed by Microsoft, introduced with Windows 3.0 in 1990. Vector graphics are composed of objects and their geometric relations, in contrast to raster graphics which are made of a grid of pixels. The .wmf format also supports raster graphics, albeit in a limited manner - embedded bitmaps (DIBs) can appear alongside GDI drawing commands within the file.
Internally, the format records a sequence of 16-bit Windows GDI commands. The most common variant is the Placeable WMF (Aldus APM), prefixed with a 22-byte header identified by the magic bytes D7 CD C6 9A at offset 0.
The format never gained much popularity compared to other similar formats. It offered limited image scaling capabilities and was cumbersome to use in larger projects, partly because 16-bit signed coordinates cap precision to ±32,767 logical units. Microsoft replaced it with the 32-bit .emf (Enhanced Metafile) in 1993; a GZIP-compressed variant saves as .wmz.
Security & safety
RISK: MEDIUMA normal WMF contains drawing commands, not macros, so the picture content is passive. The real concern is parser exploits: the 2005-2006 Windows Metafile vulnerability abused the SETABORTPROC metafile record to execute arbitrary code just from viewing a crafted WMF, and GDI metafile parsing has had periodic CVEs since. Keep Windows and Office patched and be cautious with unsolicited .wmf files from unknown senders. A WMF inside an ordinary old Office document is almost always harmless clipart.
Format details
in a nutshellPrograms that open WMF files
Technical details
deep spec| File type | 16-bit Windows GDI vector metafile; stores a replayed sequence of GDI drawing commands |
| Encoding | Binary record stream, little-endian byte order |
| MIME type | `image/wmf`; alternatives: `image/x-wmf`, `application/x-msmetafile` |
| Magic bytes (Placeable WMF) | `D7 CD C6 9A` at offset 0 in the Placeable (Aldus APM) variant |
| Magic bytes (bare WMF) | `01 00 09 00` (memory metafile) or `02 00 09 00` (disk metafile) |
| File structure | Optional 22-byte Aldus APM header + 18-byte WMF header + GDI record sequence + EOF record |
| Coordinate precision | 16-bit signed integers, ±32,767 logical units per axis |
| Color depth | Device-dependent; GDI records use palette or RGB values; embedded DIBs support 1-24 bpp |
| Embedded bitmaps | Device-independent bitmaps (DIBs) can be included within the GDI record stream alongside vector records |
| Compression | None; GZIP-compressed variant is `.wmz` |
| Checksum | 16-bit XOR checksum field in the Aldus APM placeable header only |
| Successor format | `.emf` (Enhanced Metafile), 32-bit GDI replacement since Windows NT 3.1 (1993) |
| Platform support | Windows (native GDI); macOS and Linux via Inkscape, LibreOffice Draw, Adobe Illustrator |
| Security note | `SETABORTPROC` escape record vulnerability permitted arbitrary code execution; widely exploited in 2005-2006 |
| Released | 1990 (Windows 3.0); documented publicly as MS-WMF |
| Latest version | MS-WMF specification (format frozen; superseded by EMF) |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |
WMF conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about WMF files.