What is the DMG file format?
Files with the .dmg extension are disk images used in macOS systems. These files are most commonly encountered as installers for software downloaded from the internet. They are opened with Apple's Disk Utility application, which mounts them as volumes - after mounting, the image appears in the Finder file manager as a new volume, just like a physical drive. Internally, .dmg uses Apple's UDIF (Universal Disk Image Format), with optional zlib or bzip2 compression and optional AES-128 or AES-256 encryption.
.dmg images may comprise different types of file systems, including HFS+, APFS, and FAT32. It is also possible to create hybrid images containing multiple file systems. Images can optionally be password-protected, making them a common distribution vehicle for software requiring controlled access. Using Disk Utility, an image can also serve as a source for burning CDs or DVDs.
In some situations, .dmg files contain installation software necessary for installation of the programs within them - they do not require any additional tools, as the installer runs directly from the mounted volume.
In macOS, .dmg files replaced the .IMG format used in the earlier Mac OS Classic system. Although .dmg files are designed for macOS, there are tools that allow converting them into formats supported by Windows, such as .ISO. However, not every .dmg image can be properly converted to a Windows-compatible format - furthermore, there is no guarantee the image will work correctly on that platform.
Apple also offers related sparse image formats: .sparseimage (a growable single-file container) and .sparsebundle (a directory-based variant used by Time Machine for backups).
Security & safety
RISK: MEDIUMA DMG is a container, so the risk comes from what's inside, not the format. On macOS, only mount DMGs from trusted sources: a malicious DMG can carry trojaned apps or fake installers, and macOS Gatekeeper/notarization checks help but aren't foolproof - prefer apps from the Mac App Store or the developer's official site, and be suspicious of DMGs that tell you to drag an app onto 'Terminal' or run a script. On Windows the Mac app can't execute, so an extracted DMG is low-risk to inspect, but don't assume a DMG downloaded from a random link is the genuine software. Verify checksums/signatures when the developer provides them.
Format details
in a nutshellPrograms that open DMG files
Technical details
deep spec| Container format | UDIF (Universal Disk Image Format), Apple's proprietary disk image standard |
| Developer | Apple Inc. |
| MIME type | application/x-apple-diskimage |
| File identification | 512-byte "koly" trailer block at end of file (offset −512 from EOF); no fixed signature at byte offset 0 |
| Compression methods | None (uncompressed), zlib (UDZO), bzip2 (UDBZ); LZFSE supported in newer macOS versions |
| Encryption | Optional AES-128 or AES-256 password protection; encrypted images use an "encrcdsa" header |
| Supported file systems | HFS+, APFS, FAT32, exFAT, ISO 9660; hybrid multi-filesystem images are supported |
| Image subtypes | Read/write (UDRW), read-only (UDRO), compressed (UDZO), DVD/CD master (UDTO), sparse (UDSP) |
| Sector addressing | 64-bit sector numbers; image size is limited by the host file system, not the UDIF format itself |
| Mount behavior | Mounts as a virtual volume under /Volumes/ on macOS and appears as a removable drive in Finder |
| Internet-enabled mode | Optional flag that causes macOS to auto-unpack the image contents and discard the .dmg file after first mount |
| Embedded SLA | Can contain a Software License Agreement displayed to the user before the image is mounted |
| Segment support | Large images can be split into numbered multi-part segments using the .dmgpart extension |
| Partition table support | Can embed a full GPT or Apple Partition Map (APM) with multiple partitions |
| Cross-platform access | Extractable on Linux and Windows using dmg2img, 7-Zip/p7zip, and HFSExplorer (read-only) |
| Released | 2000s (UDIF disk image, the .dmg format used since Mac OS X) |
| Specification | newosxbook.com |
DMG conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DMG files.