How to Convert a DMG File to an ISO Image on macOS Using hdiutil in Terminal

If you download software or operating system installers on a Mac, they almost always arrive packaged as a .dmg (Apple Disk Image) file. This format is perfect for macOS, allowing you to double-click the file to mount it like a virtual flash drive. However, if you need to use that disk image on a Windows machine, or if you want to use it in a cross-platform virtual machine like VirtualBox, the .dmg format is completely useless.

You need to convert the file into the universally recognized .iso format. While the App Store is full of paid utilities claiming to do this, macOS actually has a powerful, free conversion tool built directly into its command-line interface called hdiutil.

The Conversion Process

Using hdiutil is incredibly fast and requires no third-party software installations.

  1. Open the Terminal app on your Mac (you can find it in Applications > Utilities, or by searching in Spotlight).
  2. Locate the .dmg file you want to convert in a Finder window (for example, in your Downloads folder).
  3. In the Terminal window, type the following command, but do not press Enter yet, and make sure to leave a space at the end:
    hdiutil convert 
  4. Drag and drop the .dmg file from Finder directly into the Terminal window. The Terminal will automatically paste the exact file path. It should now look something like this:
    hdiutil convert /Users/YourName/Downloads/Software.dmg 
  5. Next, type -format UDTO -o (again, note the space at the end).
  6. Finally, type the destination path and the new name you want for the file, ending with .iso. Your complete command should look similar to this:
    hdiutil convert /Users/YourName/Downloads/Software.dmg -format UDTO -o /Users/YourName/Desktop/SoftwareConverted.iso
  7. Press Return to execute the command.

The Final Output (.cdr vs .iso)

Depending on the specific version of macOS you are running, hdiutil will successfully convert the file but might append a .cdr extension to the output file instead of .iso (e.g., SoftwareConverted.iso.cdr).

Do not panic. A Apple .cdr file generated using the UDTO format is byte-for-byte identical to a standard .iso file. It is exactly the same format, just with a Mac-specific naming convention applied at the end.

To fix this, simply click on the new file on your Desktop, press Return to rename it, and delete the .cdr from the end of the filename so it simply ends in .iso. macOS will ask you if you are sure you want to change the extension; click Use .iso.

Your file is now a standard ISO image, ready to be burned to a disc, mounted in Windows, or attached to any virtual machine.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.