Create an Encrypted Disk Image on Mac: Step-by-Step
In this article
Creating an encrypted disk image on a Mac gives you a password-protected container for sensitive files. When you mount the image, macOS asks for your password; without it, the contents remain scrambled and unreadable. This guide shows you how to build one using the built-in Disk Utility app—no extra software needed.
What You'll Need
- A Mac running macOS 10.15 (Catalina) or later (the steps are similar on older versions).
- Enough free disk space for the image size you choose (the image reserves space on your drive).
- An administrator account (you'll need to enter your Mac password to create the image).
Step-by-Step
- Open Disk Utility. Go to Applications > Utilities and double-click Disk Utility. Alternatively, press Cmd+Space, type “Disk Utility,” and hit Return.
- Start the New Image wizard. In the menu bar, click File > New Image > Blank Image…. (If you're on macOS Ventura or later, the menu is still there, but the window looks slightly different.)
- Name the image file. In the “Save As” field, type a filename for the .dmg file itself (e.g., “MyVault”). This is the file you'll store on your disk.
- Set the image name (volume name). In the “Name” field, enter the name that will appear when you mount the image (e.g., “Private Files”). This is what shows up on your desktop and in Finder.
- Choose a size. In the “Size” dropdown, pick a size for the encrypted container. You can type a custom size (e.g., 500 MB, 2 GB). This is the maximum amount of data you can store inside. You can't easily change it later, so choose a comfortable size.
- Select encryption. In the “Encryption” dropdown, choose either 128-bit AES (faster, still very secure) or 256-bit AES (stronger, slightly slower). For most people, 128-bit is fine; for maximum security, pick 256-bit.
- Set the format. In the “Format” dropdown, choose APFS (if you're on macOS 10.13 or later) or Mac OS Extended (Journaled) for older Macs. APFS is the modern default and works well.
- Choose the partition scheme. Leave “Partitions” as Single Partition – GUID Partition Map unless you have a specific reason to change it.
- Click “Save” and set a password. A dialog will appear asking for a password. Enter a strong password and verify it. Add a password hint if you like (it's optional). Important: If you forget this password, there is no way to recover the data. Write it down and store it somewhere safe.
- Wait for creation. Disk Utility will create the image. This can take a few seconds or minutes depending on the size. When it's done, the image will mount automatically (its icon appears on your desktop and in Finder).
- Use the image. Drag files into the mounted volume to store them. When you're done, eject it (right-click the volume and choose “Eject,” or drag it to the Trash). The files are now encrypted and safe.
Common Mistakes
- Choosing too small a size. If you fill the image, you'll get “disk full” errors. You can't resize a standard image easily; you'd have to create a new one and copy files over.
- Forgetting the password. There is no “forgot password” button. If you lose it, your data is gone forever.
- Using the wrong format. If you plan to use the image on an older Mac (pre-2017), APFS might not be readable. Stick with Mac OS Extended for maximum compatibility.
- Not ejecting properly. Just closing the window doesn't eject the volume. Always eject it from Finder or Disk Utility to ensure all data is written.
- Saving the image on an unencrypted drive. The image itself is encrypted, but if you store it on a cloud service or external drive, the file is still protected by the password. That's fine—just don't store the password alongside it.
Tips
- Use a password manager to generate and store a strong, unique password for your image.
- Make a sparse image if you want an image that grows as you add files. In step 5, choose “Sparse Disk Image” from the “Format” dropdown (instead of APFS). This creates a file that starts small and expands up to your size limit.
- Back up the image file like any other important data. If the file gets corrupted, the password won't help.
- Use FileVault for whole-disk encryption if you need to protect everything on your Mac, not just a few files. The encrypted image is best for specific folders or for transferring files securely.
- Test the image after creating it: eject it, then double-click the .dmg file to mount it again and confirm your password works.
Troubleshooting
- “The operation couldn't be completed. (OSStatus error 100093)” – This often means the image is corrupted or the format is incompatible. Try creating a new image with a different format (e.g., Mac OS Extended instead of APFS).
- You can't mount the image after moving it to another Mac. Make sure the other Mac supports the format (APFS requires macOS 10.13+). If not, use Mac OS Extended (Journaled) when creating the image.
- You forgot the password. There is no recovery. If you have a hint, try to remember it. Otherwise, the data is unrecoverable—this is by design.
- The image won't eject. Close any open files or windows that are using it. If it still won't eject, try logging out and back in, or restart your Mac.
- The image is “read-only.” If you created the image as “Read-Only” (in the “Image Format” dropdown), you can't add files. Recreate it as “Read/Write” to make it writable.
Frequently Asked Questions
Can I change the size of an encrypted disk image later?
Not directly. You can create a new image with a larger size and copy the contents over, or use a “sparse image” which grows automatically up to the limit you set.
Is 128-bit AES encryption enough?
Yes, 128-bit AES is considered secure for virtually all purposes. 256-bit offers a higher safety margin but is slightly slower. For most users, 128-bit is perfectly fine.
Can I use the same password for multiple images?
You can, but it reduces security. If one image's password is compromised, all are. Use a unique password for each, or use a password manager.
Will the encrypted image work on Windows?
No. Disk Utility images (.dmg) are Mac-native. Windows cannot mount them without third-party software. If you need cross-platform encryption, consider using VeraCrypt or a password-protected ZIP file.
What happens if I delete the .dmg file?
You delete the encrypted container and everything inside it. Make sure you have a backup if you need the data.
Can I encrypt an existing folder without copying files?
Yes, you can use Disk Utility's “New Image from Folder” option (File > New Image > Image from Folder). This creates an encrypted .dmg containing the folder's contents, but the original folder remains unencrypted—you'll want to delete it afterward.