How to Encrypt a Folder on Mac: 3 Ways That Actually Work
Encrypt a folder on Mac three ways: Disk Utility, Terminal hdiutil, or Finderlock. Steps, a comparison table, and the password risks to know.
macOS has no switch that encrypts a single folder in place. To encrypt a folder on Mac, you put it inside an encrypted container: a disk image made with Disk Utility or Terminal, or an encrypted file made by an app such as Finderlock. This guide covers all three, shows what each one leaves behind, and explains the rule that matters most: if you lose the password, the data is gone.
Why there is no right-click 'Encrypt' for folders
If you right-click a folder in Finder, you will not find an Encrypt option. The Encrypt item you may have seen in Finder appears for drives and volumes (an external disk, for example), not for a single folder. Apple's built-in answer for whole-disk protection is FileVault, covered below. For one folder, the built-in route is an encrypted disk image.
That is why most guides for this search send you to Disk Utility or Terminal. Both work. Both have rough edges, and it helps to know them before you start.
Method 1: Disk Utility (encrypted .dmg from a folder)
This is the no-install option. It turns a folder into a single encrypted .dmg file that you mount with a password.
- Open Disk Utility (Applications > Utilities, or search with Spotlight).
- In the menu bar choose File > New Image > Image from Folder. Menu wording can shift slightly between macOS versions, so if you do not see it, look under File > New Image.
- Select the folder you want to encrypt and click Choose.
- Give the image a name and a save location.
- Under Encryption, pick 128-bit AES or 256-bit AES. Both are strong. If you have no reason to choose otherwise, take 256-bit.
- Enter a password and confirm it. Click Choose when prompted.
- Under Image Format, pick one:
- Read/write lets you mount the image and add, edit and delete files.
- Read-only is fixed. To change the contents you would create a new image.
- Other formats such as compressed may be listed. They are read-only too.
- Click Save and wait for it to finish.
To use the contents, double-click the .dmg, enter the password, work in the mounted volume, then eject it in Finder when you are done.
What it does well: it is built in, free, and the encryption is real. Without the password the file is unreadable.
Where it falls short:
- The original folder is still there. Disk Utility copies the folder into the image. Your unencrypted original stays where it was until you delete it yourself.
- When you mount the image, macOS may offer to remember the password in your Keychain. If you accept, anyone logged in as you may be able to mount it without typing anything. Decline if the point is to keep people out of your own session.
- While the image is mounted, its contents are readable like any other disk. Forgetting to eject is the most common way this setup leaks.
- Editing is clumsy: you create, mount, edit, eject, and repeat for every folder.
Method 2: Terminal with hdiutil (encrypted sparse bundle)
Disk Utility's image tools sit on top of a command-line tool called hdiutil. Using it directly gets you a sparse bundle, a disk image stored as many small files ('bands') instead of one big file. That layout can suit folders that change often and are synced or backed up, since only changed bands need to be copied.
This command creates an encrypted sparse bundle from a folder. Adjust the paths to match yours:
hdiutil create -encryption AES-256 -type SPARSEBUNDLE -fs APFS -volname Private -srcfolder ~/Documents/Private ~/Desktop/Private
What the options do:
-encryption AES-256encrypts the image.hdiutilwill prompt you for a passphrase in the terminal.-type SPARSEBUNDLEmakes a growable bundle rather than a single fixed-size file.-fs APFSsets the file system inside the image.-volname Privateis the name the volume shows when mounted.-srcfolderis the folder to copy in.- The last argument is the output name.
hdiutiladds the.sparsebundleextension for you.
To open it and then close it again:
hdiutil attach ~/Desktop/Private.sparsebundle
hdiutil detach /Volumes/Private
attach asks for the password and mounts the volume under /Volumes. detach ejects it. If the volume name is different on your Mac, check what appears in /Volumes.
Warning: your original is still unencrypted.
-srcfoldercopies the contents. It does not move or protect the source. Open the sparse bundle first and confirm that your files are inside and readable. Only then should you move the original folder to the Trash. Deleting it is the step that cannot be undone, and an ordinary delete is not a secure erase. On an SSD, you generally cannot be sure deleted data is unrecoverable.
What it does well: it is scriptable, free, and gives you finer control than the Disk Utility dialog.
Where it falls short: it is all typed commands, and the same leftover-original and mount-then-forget problems apply. A typo in a path is easy to make and annoying to debug.
Method 3: Finderlock (right-click Protect)
Finderlock is a Mac app that does not use disk images at all. Each protected item is encrypted into its own .secured container using AES-256-GCM through Apple's CryptoKit. A folder is archived first, then sealed in independent 4 MB chunks. The key is derived from your password with PBKDF2-HMAC-SHA256 (150,000 iterations and a random 32-byte salt).
To encrypt a folder:
- Install Finderlock. It requires macOS 13.5 or later.
- Right-click the folder in Finder and choose Protect. The right-click menu and badges rely on a Finder extension that needs macOS 14. On macOS 13.5 you can add the folder by dragging it into the Finderlock dashboard.
- Choose a password for that item. It is stored in your macOS Keychain. With a Personal plan or above you can use Touch ID instead.
- Finderlock encrypts the folder into a
.securedcontainer and leaves a placeholder file at the original location. - To open it again, double-click the placeholder. It unlocks without opening the main app window. The right-click menu also has Lock and Unlock.
Some extras you can switch on: auto-lock after inactivity or sleep, lock-on-close (it notices when the app that opened a file quits), an optional master password with a 5-minute session, and iCloud or Google Drive backup of the encrypted containers. Pro adds smart rules, such as locking on logout, user switch, screen saver or system lock.
Where it falls short: it is a third-party app, so you are trusting software you installed rather than something that ships with macOS. The free plan covers 3 protected items without Touch ID. More items and Touch ID need a paid plan. If you only need to encrypt one folder once, Disk Utility is enough.
The three methods compared
| Disk Utility (.dmg) | Terminal (hdiutil sparse bundle) | Finderlock | |
|---|---|---|---|
| Effort | Medium: several dialogs per folder | Higher: typed commands | Low: right-click Protect |
| Original left behind | Yes, you must delete it yourself | Yes, you must delete it yourself | Placeholder file at the original location |
| Touch ID | Not built in | Not built in | Yes, on Personal and above |
| Finder integration | Double-click to mount; no right-click create | None | Right-click menu and badges (macOS 14+), double-click placeholder to unlock |
| Cost | Free, built in | Free, built in | Free for 3 items; paid plans for more |
| Encryption | AES-128 or AES-256 | AES-256 | AES-256-GCM in per-item .secured containers |
What about FileVault?
FileVault is Apple's full-disk encryption. It protects everything on the startup disk while the Mac is off or locked at the login window, and it is worth turning on (look under System Settings > Privacy & Security; the exact path varies by macOS version). If your laptop is stolen, FileVault is the thing that stops someone reading your drive.
But it protects the whole disk only. Once you are logged in, your files are readable to anything running as you, and to anyone sitting at your unlocked Mac. It does nothing to protect one folder from a housemate, a shared session, or a file you copy elsewhere. It is a good base layer and a poor substitute for per-folder encryption. If you want to compare approaches, see our FileVault alternative page.
Before you encrypt: copy first, and never lose the password
Encryption does not forgive mistakes. Three rules:
- Keep a separate copy until you have tested. Mount or unlock the encrypted version, open a few files, and confirm everything is there before deleting any original.
- There is no recovery. Apple cannot open a disk image whose password you forgot, and Finderlock cannot decrypt a container without the right password. A forgotten password means lost data. Store passwords in a password manager.
- Back up the encrypted file, not just the memory. A damaged
.dmg, sparse bundle or.securedcontainer can fail like any file. Keep a copy somewhere else, such as an external drive or cloud storage. Finderlock can back encrypted containers up to iCloud or Google Drive for you.
For a wider look at your options, read 4 ways to password protect a folder on Mac, or see best Mac encryption apps.
FAQ
Can I encrypt a folder on a Mac without installing anything?
Yes. Use Disk Utility (File > New Image > Image from Folder) or the hdiutil command in Terminal. Both produce an encrypted disk image you open with a password.
Is there a right-click option to encrypt a folder in macOS?
Not for a single folder. The Encrypt item in Finder's menu appears for drives. For folders you need a disk image or a third-party app that adds its own menu.
Is 128-bit or 256-bit AES better for a Disk Utility image?
256-bit has the larger key and is the safer default. For most people the practical difference is small. A weak password is a far bigger risk than the choice of key length.
Does FileVault encrypt my folders?
FileVault encrypts the whole startup disk, so the folders on it are protected while the Mac is off or at the login screen. It does not add a separate lock to any one folder while you are logged in.
What happens if I forget the password?
You lose access to the contents. Neither the built-in tools nor Finderlock offer a way around a forgotten password. Keep the password in a password manager and keep a tested backup.
Next step
If you only need to encrypt one folder occasionally, try Disk Utility and delete the original once you have verified the image. If you do it often, or want right-click access and Touch ID, Finderlock has a free plan that covers 3 protected items. You can read how the encryption works on the security page or in the docs.