Open a Mac .dmg on Windows or Linux
A .dmg is a Mac disk image: usually an app installer, sometimes a shared folder or a backup. Windows, Linux and Chromebooks cannot open one. Drop it here to see every file and folder inside and save any one of them, with the app’s name, version and the macOS it needs.
The image is read by this tab on your device, a piece at a time, and is not uploaded. A 1 GB image is never loaded whole.
What it shows
- Every file and folder. The tree of the image’s HFS+ volume (Mac OS Extended, or its case-sensitive HFSX form) with sizes and dates. Folders open on a tap; app bundles such as
Rectangle.appare folders too, so you can walk intoContents/Resources. Symbolic links, like theApplicationsshortcut most installers show, are listed with their target. - Save any one file. Each file is unpacked only when you ask for it: its chunks are decompressed in the tab and handed to your browser as a download. Files stored with HFS+ compression (common inside apps) are unpacked too. A PDF manual, a picture or a ZIP inside the image can also be opened here in its own viewer.
- The app inside. For each
.appbundle, from itsInfo.plist: the name, the bundle ID (such ascom.knollsoft.Rectangle), the version and build, the oldest macOS it runs on, and whether the program is built for Intel, Apple silicon or both (a “universal” app). That answers “will this run on my old Mac?” before you carry the file over. - How the image is built. The UDIF version, the packed and unpacked size, which compression each chunk uses (zlib, bzip2, LZFSE, ADC, stored, zero-fill or free space), the partition map (GPT or Apple Partition Map) with its partitions, the stored checksums, and whether the image itself carries a code signature, with the signer’s name when there is a certificate.
- The licence agreement. Many installers show a licence before they open on a Mac. Its text is stored in the image in one or more languages; it is shown here as text, with the language names and button labels the image defines.
What is inside a .dmg
- A disk, cut into compressed chunks
- A .dmg holds the bytes of a whole disk: a partition map and a volume with its files. The disk is cut into chunks of up to about 1 MB, and each chunk is compressed on its own, so one file can be read without unpacking the rest. Free space is not stored at all. At the end of the file sits a 512-byte trailer starting with
koly, which points at the table of chunks (an XML property list, or a classic Mac resource fork in very old images). - The formats, by their hdiutil names
- UDZO: zlib, the usual “compressed” image and the most common. UDBZ: bzip2, smaller and slower (Mac OS X 10.4 and later). ULFO: LZFSE, Apple’s own fast compressor (OS X 10.11 and later). ULMO: LZMA (macOS 10.15 and later). UDCO: the old ADC compression. UDRO and UDRW: not compressed. This page reads all of them except ULMO.
- A worked example
- The installer of the window manager Rectangle 2.0.2 is a 4.5 MB file. Inside is a 35 MB disk with a GPT partition map and one HFS+ partition named “disk image”; 24 MB of it is free space, stored as nothing. Seventeen zlib chunks hold 10 MB of disk in 3.5 MB. The volume holds 156 files (9.6 MB):
Rectangle.app, theApplicationslink and a background picture. The app’s Info.plist says bundle IDcom.knollsoft.Rectangle, version 2.0.2, build 109, macOS 14.0 or later, and its program carries both Intel and Apple silicon code. - HFS+ or APFS
- Most installers use HFS+, which this page reads. Images made on newer Macs can hold an APFS volume instead; the page recognises APFS and says so, but cannot list its files yet.
How the file is read
- Written for this site
- The trailer, chunk tables, partition maps and the HFS+ catalog are read by viewhack’s own code, written from Apple’s Technical Note TN1150 (HFS Plus Volume Format), the UEFI specification (GPT) and public descriptions of the UDIF format. The bzip2 and ADC decoders were written from their format descriptions; LZFSE and LZVN are a port of Apple’s open-source reference decoder (BSD licence); zlib uses the vendored fflate library. No code from GPL tools such as dmg2img or libdmg-hfsplus is used.
- A piece at a time
- Opening an image reads only its last 512 bytes, the chunk table and the chunks that hold the partition map and the catalog of files. Saving a file decompresses just the chunks that file lives in. That is why a large image opens quickly and does not fill your phone’s memory.
- Tested on
- The real Rectangle 2.0.2 installer (MIT licence), and generated images that use every chunk kind (stored, zero-fill, free space, zlib, bzip2, ADC and LZFSE), GPT, Apple Partition Map and unpartitioned disks, HFS+ and HFSX, files split across many fragments, HFS+-compressed files, a resource fork, a licence in plain text and in RTF, and an encrypted image. The LZFSE decoder is checked against files made by Apple’s reference encoder.
What this cannot do
- Install or run apps. A Mac app is a program for macOS: it does not run on Windows, Linux or in a browser. This page shows what is inside and saves files; it does not install anything.
- Open encrypted images. An encrypted .dmg (header
encrcdsa) keeps even its file names inside the encrypted part. It is recognised and refused; this page never asks for a password. - Read APFS volumes. If the image holds APFS, the page says so and shows the image’s summary, but cannot list or save the files. 7-Zip and any Mac can open them.
- Sparse images and bundles. A
.sparseimageis a different format from a UDIF .dmg: it is recognised and named, not read. A.sparsebundleis not one file but a folder of “band” files, so it cannot be dropped here at all. - Check a signature. A signer’s name shown here is what the image stores. No certificate chain or hash is checked, so it is not a trust check; on a Mac, Gatekeeper does that when the image is opened.
- The rest. LZMA-compressed (ULMO) chunks, the original HFS format of the 1990s, and segmented images split into
.dmgpartfiles are not read. Resource forks are noted but not saved. A large file is unpacked into the tab’s memory before it is saved, so a several-GB file inside an image may not fit on a phone.
Other ways to open them
- Windows
- 7-Zip (free) lists and extracts most .dmg files, including APFS ones in recent versions. HFSExplorer (free) reads HFS+ images.
- Linux
- 7-Zip (the
7zcommand) extracts most images; dmg2img converts one to a raw image that the kernel’s hfsplus driver can mount; apfs-fuse reads APFS. - Mac
- Double-click mounts it. In Terminal,
hdiutil imageinfoshows the same facts as this page, andhdiutil convertchanges the format.