
An encrypted disk image is a password-protected file that acts like a virtual drive on your Mac. You can store documents, photos, tax records, and other sensitive files inside it, then eject the image when you are finished. When the image is ejected, its contents are not available through Finder until the correct password is entered again.
Quick Answer
To create an encrypted disk image in Disk Utility:
- Open Disk Utility from Applications > Utilities. 2. Select File > New Image > Blank Image. 3. Enter a name, storage location, size, and format. 4. Choose an encryption option, such as AES-256. 5. Create and confirm a strong password. 6.
What an Encrypted Disk Image Does
A disk image is a file that contains a virtual volume. When you open it, macOS mounts that volume and displays it in Finder like a removable drive. You can copy files into it, create folders, and work with its contents normally.
Encryption scrambles the data so it cannot be read without the password. The password is usually requested when you open or mount the image. After you eject the image, the encrypted file remains on your Mac, but its contents are not mounted for normal access.
This method is useful when you want to:
- Keep a small collection of sensitive files in one protected location
- Create an encrypted archive for documents
- Store private files on an external drive
- Share an encrypted file with another Mac user
- Protect files without encrypting an entire drive
Important limitations
An encrypted disk image is not the same as encrypting your Mac’s startup disk. It protects only the files placed inside the image. Files copied outside it remain unprotected unless another security feature covers them.
Also, the image is only as secure as its password and the places where you store it. Anyone who obtains the image file still cannot open it without the password, but deleting or corrupting that file can make the contents unavailable.
Before You Begin
Choose where you want to save the image. You can store it in your home folder, on an external drive, or in another location with enough free space.
Think about the image size before creating it:
- A fixed-size image reserves the full amount of space immediately.
- A sparse image grows as you add files, up to a maximum size.
- A sparse bundle also grows as needed and stores data in smaller bands, which can be more convenient for some storage and backup situations.
For a simple encrypted folder, a sparse image is often convenient because it does not immediately consume the entire maximum size. However, the image can still grow until it reaches the limit you specify.
Create a password that is long and unique. Disk Utility does not provide a way to recover the contents of an encrypted image if you permanently forget the password. Do not save the only copy of that password inside the image itself.
Warning: Creating the image does not delete existing files. However, if you later copy, move, or delete files while organizing the image, macOS may place those items in the Trash or remove them immediately from an external volume. Check your selections carefully before deleting anything.
Create an Encrypted Disk Image in Disk Utility
1. Open Disk Utility
Open Finder, select Applications in the sidebar, open the Utilities folder, and then double-click Disk Utility.
You can also press Command-Space, type Disk Utility, and press Return.
Disk Utility normally shows disks and volumes in its sidebar. For this task, you do not need to select an existing physical disk.
2. Start a blank disk image
In the menu bar, choose:
File > New Image > Blank Image
Disk Utility displays options for creating a new image.
If you do not see the expected menu, make sure Disk Utility is the active application by clicking its window once.
3. Name the image and choose a location
Enter a name in the Save As field. This is the name of the encrypted disk image file and may also become the name of the mounted volume.
Choose a location in the Where menu. Select a folder or drive where you want to keep the image.
Avoid saving the image in a location that is routinely cleaned up or automatically removed. If you plan to use the image on an external drive, confirm that the drive remains connected while Disk Utility creates it.
4. Set the image size
Enter the maximum amount of storage the image should provide in the Size field. Select the appropriate unit, such as MB, GB, or TB.
Choose a size large enough for the files you expect to store, but do not make it unnecessarily large if you are using a fixed-size image.
5. Choose an encryption method
Open the Encryption menu and choose an available encryption option. Disk Utility may show choices such as:
- AES-128: Strong encryption with potentially lower processing overhead
- AES-256: Stronger encryption, with potentially more processing overhead
For most users, AES-256 is an appropriate choice for highly sensitive files. If compatibility with older systems or devices is important, check whether the image will be opened only on Macs that support the selected option.
The available choices can vary depending on your Mac and macOS version. Use the option that appears in Disk Utility rather than relying on a choice that is not listed.
6. Create and confirm the password
After you choose encryption, Disk Utility asks you to enter a password.
Type the password in the Password field, then enter it again in Verify. Use a long, unique password that you can retrieve securely. A password manager is generally safer than writing the password on a loose note or saving it in an unprotected text file.
If macOS offers to remember the password in Keychain, consider whether that matches your security goal. Saving the password in Keychain can make access more convenient, but someone who can use your unlocked Mac account may also be able to access the image more easily.
Click Choose or the equivalent confirmation button after entering the password.
Warning: If you forget the password and do not have another copy, you may not be able to open the encrypted image. Disk Utility cannot bypass the encryption.
7. Choose the file-system format
Open the Format menu and choose a file system.
For an image used only with current Mac systems, APFS may be suitable when it is available. Mac OS Extended (Journaled) can be useful for broader Mac compatibility, especially with older Mac software.
For an ordinary Mac-only encrypted storage image, choose the Mac file-system format that best matches the systems where you will use it.
8. Choose the image type
Open the Image Format menu. Common choices include:
- Read/Write Disk Image: A normal image that you can open and modify
- Sparse Disk Image: Expands as data is added, up to the maximum size
- Sparse Bundle Disk Image: Expands in smaller sections rather than one large file
- Read-only formats: Intended for data that should not be changed
Choose Read/Write Disk Image if you want a straightforward image with a fixed size. Choose Sparse Disk Image if you want it to grow as needed within the limit you set.
A sparse image can still become too large for the available storage. Monitor free space on the Mac or external drive where it is saved.
9. Create the image
Review the settings, then click Save. Disk Utility creates the image and may ask for your Mac login password or the encryption password during the process.
Wait until the operation finishes. Do not disconnect an external drive or force quit Disk Utility while the image is being created.
When the process completes, click Done.
Open and Use the Encrypted Disk Image
Locate the new .dmg file in Finder and double-click it.
macOS asks for the encryption password. Enter it and click OK, Unlock, or the available confirmation button.
After the password is accepted:
- The disk image mounts as a volume.
- The volume appears in Finder’s sidebar under Locations.
- A corresponding icon may appear on the desktop, depending on your Finder settings.
- You can open the volume and copy files into it.
Treat the mounted image like an external drive. You can create folders, rename files, and move documents into it. Wait for copying to finish before ejecting the image.
If you need a reminder about the difference between mounting and ejecting, see how to mount and unmount a disk in Disk Utility on Mac.
Eject the Image When You Finish
Close files stored inside the mounted image, then eject the volume before shutting down, disconnecting an external drive, or moving the image file.
You can eject it in any of these ways:
- In Finder, click the Eject button next to the mounted volume.
- Control-click the volume and choose Eject.
- Drag the volume to the Trash, which changes to an Eject icon.
Ejecting removes the mounted, readable version of the volume. The encrypted .dmg file remains where you saved it.
Warning: Do not move or disconnect the storage device while files are being copied or while the image is mounted and in use. Doing so can interrupt writes and may damage the image or its contents.
Manage, Move, or Back Up the Image
The .dmg file is the object you need to protect and back up. Copy it only after the image is ejected, especially if it contains recently changed files.
You can move the image to another folder or external drive like any other file, provided the destination has enough free space and supports the file size. Keep at least one backup if the contents are important.
An encrypted image protects data if someone obtains the file, but it does not protect against accidental deletion, drive failure, or corruption. A backup should be stored separately from the original. If the image is stored in cloud storage, the cloud account and the stored file have their own security considerations.
Avoid opening the same read/write image simultaneously from multiple Macs or multiple locations. This can cause conflicts or corruption, particularly when the image is stored on a file-sharing service rather than a directly attached drive.
Troubleshooting
Disk Utility says there is not enough space
A fixed-size image requires enough free space for the size you entered. Select a smaller size, remove unnecessary files from the destination, or choose a sparse format if it fits your use case.
Remember that a sparse image still needs free space as it grows.
The encrypted image will not open
Confirm that you are opening the correct .dmg file and entering the exact password used when it was created. Passwords are case-sensitive.
Do not repeatedly modify the image or delete related files while troubleshooting. If the file is stored on an external drive, check that the drive is connected properly and appears in Finder.
The image opens but files cannot be copied into it
The image may be read-only, full, or mounted with a file-system problem. Check the available space inside the mounted volume in Finder by selecting it and choosing File > Get Info.
If the image has a fixed size and is full, you generally cannot increase its capacity as easily as adding space to a normal folder. Create a larger image and copy the files into it if necessary.
The image is not visible in Finder
The image may not have mounted successfully. Double-click the .dmg file again and enter the password. Check Finder settings under Finder > Settings > General and Finder > Settings > Sidebar to confirm that connected disks and volumes are displayed.
If a physical external drive is missing rather than only the image, check its cable, power, and connection. You can also review Apple’s Disk Utility repair steps in how to repair a Mac disk with First Aid.
Disk Utility reports an error while creating the image
Make sure the destination drive is connected and has sufficient space. Try saving the image to a local folder on the Mac to determine whether the external drive or destination format is involved.
If the destination disk itself is not appearing correctly in Disk Utility, use how to fix a startup disk not showing on Mac only when the missing device is a startup disk or the issue involves disk detection.
Frequently Asked Questions
Can I change the password later?
Disk Utility may allow you to change an image password through its image-management options, but the exact controls can vary.
Can I use the image on another Mac?
Usually, yes, if the other Mac supports the image’s encryption and file-system formats.
Does ejecting the image encrypt the files again?
The data remains encrypted inside the .dmg file. Ejecting simply removes the readable mounted volume from Finder until you unlock it again.
Final Thoughts
Disk Utility can create a convenient encrypted container for sensitive Mac files without requiring you to encrypt an entire drive.