How to Encrypt a File on Mac: 4 Ways, From Built-In to One-Click
Learn how to encrypt a file on Mac four ways: Preview and iWork passwords, an encrypted disk image, Terminal, or Finderlock. Compare strength and risks.
To encrypt one file on a Mac, pick the method that fits the file type. For a PDF or an iWork document, the built-in password options are the fastest. For any other file, you can put it in an encrypted disk image, encrypt it with gpg in Terminal, or use an app that encrypts each file separately. Whichever you choose, if you lose the password you lose the file.
What FileVault does and does not do for a single file
FileVault encrypts your whole startup disk. If your Mac is lost or stolen while it is shut down or logged out, the files on it are unreadable without your login password. That is real protection, and you should leave it on.
What it does not do is protect an individual file once you are logged in. While your Mac is unlocked, any app or person using your account can open every file. FileVault also does nothing for a file after it leaves the disk: an email attachment, a copy on a USB stick, or an upload to cloud storage is not covered by it.
So FileVault answers "what if someone takes my laptop?" and per-file encryption answers "what if this one file ends up somewhere it shouldn't?" For a longer comparison, see do you need folder encryption if FileVault is on.
Method 1: Password-protect a document or PDF with built-in apps
This works only for files that these apps can open: PDFs in Preview, and Pages, Keynote and Numbers documents. It needs no extra software.
Encrypt a PDF in Preview
- Open the PDF in Preview.
- Choose File > Export... (some macOS versions list Export as PDF...).
- In the save dialog, make sure the format is PDF and tick Encrypt.
- Enter a password and enter it again to verify.
- Save the file under a new name, then check that it asks for the password when you open it.
The encrypted copy is a new file. The original is still sitting there unencrypted, so deal with it afterwards (see the warning near the end).
Encrypt a Pages, Keynote or Numbers document
- Open the document.
- Choose File > Set Password...
- Enter a password, verify it, and add a hint only if the hint does not give the password away.
- Leave Remember this password in my keychain unticked if the point is to keep other people on your Mac out.
- Click Set Password, then save.
What it does well: it is free, built in, and the file stays a normal document that opens in the app you already use.
Where it falls short: it covers only those file types. Apple does not show you the cipher in the dialog, so you cannot easily judge the strength beyond "password-protected." Some PDF viewers on other systems also treat PDF passwords differently, so test the file on the device where it will be opened. With a short or guessable password, the encryption does not matter much.
Method 2: Encrypted disk image with Disk Utility
This works for any file type, because the file is just stored inside an encrypted container. It is a manual process, but it uses only what ships with macOS.
- Create a new folder and move or copy the file you want to protect into it. Disk Utility makes images from folders, so a single file needs a folder around it.
- Open Disk Utility (Applications > Utilities).
- Choose File > New Image > Image from Folder...
- Select the folder and click Choose.
- Name the image and choose where to save it.
- Set Encryption to 256-bit AES encryption. Enter a password and verify it.
- Set Image Format. Read-only or compressed is fine for an archive. Choose read/write if you want to add files later.
- Click Save, and wait for it to finish.
The result is a .dmg file. Double-click it, enter the password, and the contents mount like a drive. When you are done, eject it. When the image is mounted, the files inside are readable, so eject it as soon as you finish. In the mount dialog, do not tick the option to remember the password in your keychain unless you accept that your logged-in account can open it freely.
What it does well: AES-256, works for any file type, and no third-party software.
Where it falls short: it is many steps for one file, the original folder is still there until you remove it, and with a read-only image you have to make a new image to change anything. You also end up with a .dmg that does not look like your file at all, so you need to name things clearly.
Warning: once the encrypted image exists and you have tested it, you will want to delete the unencrypted original. Emptying the Trash is not a secure erase, and on an SSD you cannot assume overwriting works the way it did on old hard drives. Delete only after you have confirmed the image opens with your password, because deletion cannot be undone.
Method 3: Terminal with openssl or gpg
If you are comfortable in Terminal, you can encrypt any single file with a one-line command. The tool most people reach for is gpg, which is not preinstalled on macOS. You can get it through a package manager such as Homebrew.
With gpg installed, symmetric (password-only) encryption looks like this:
gpg --symmetric --cipher-algo AES256 report.pdf
GPG prompts for a passphrase and writes report.pdf.gpg next to the original. The original is not touched. To decrypt:
gpg --output report.pdf --decrypt report.pdf.gpg
If report.pdf already exists, gpg asks before overwriting it, so read that prompt rather than answering by reflex.
The macOS openssl command works as well, but its options differ depending on which version is installed, so the exact flags are worth checking before you rely on them. We cover both tools, with the flags and the common mistakes, in how to encrypt a file on Mac with Terminal.
What it does well: strong, well-reviewed tools, scriptable, and the output is a single file.
Where it falls short: it is easy to mistype a command, there is no Finder integration, and you have to remember to delete the plaintext original yourself. If you are not already at ease with a shell, this is the method most likely to cause a mistake.
Method 4: Finderlock, right-click Protect
Finderlock is a Mac app that encrypts any file or folder from the Finder right-click menu. It is one option here, and it is built for the case where you do this regularly and do not want to manage disk images by hand.
- Install Finderlock from finderlock.com and enable its Finder extension. The right-click menu and badges need macOS 14; the app itself requires macOS 13.5 or later, and on 13.5 you can add items from the dashboard by drag and drop.
- Right-click the file in Finder and choose Protect.
- Set a password for that item, or use Touch ID if you are on a plan that includes it.
- Finderlock encrypts the file into its own
.securedcontainer and leaves a placeholder where the file was. - To open it, double-click the placeholder. It unlocks without opening the main app window. Lock re-seals it, and the menu also has Unlock and Shred.
Under the hood, each protected item gets its own .secured container using AES-256-GCM through Apple CryptoKit. The key is derived from your password with PBKDF2-HMAC-SHA256 (150,000 iterations and a random 32-byte salt). Folders are archived first and sealed in independent 4 MB chunks. Finderlock does not use disk images or sparse bundles. For details, see the security page.
Some other things that matter day to day:
- Per-item passwords are stored in the macOS Keychain. Touch ID uses a Keychain item with biometric access control. You can also set an optional app-wide master password.
- Auto-lock can trigger on inactivity or sleep, and lock-on-close detects when the app that opened a file quits. Pro adds smart rules such as logout, user switch, screen saver and system lock.
- Everything runs locally. The only network use is the license check, optional opt-in analytics, updates, and any backup you choose to set up (iCloud or Google Drive copies of the encrypted containers).
Where it falls short: it is a third-party app, not something that comes with macOS. The free plan covers 3 protected items and does not include Touch ID. Shredding is only on the Lifetime plan, and secure deletion on SSDs is never guaranteed by any tool, so do not treat it as a promise.
The four methods compared
| Preview / iWork password | Disk Utility image | Terminal (gpg/openssl) | Finderlock | |
|---|---|---|---|---|
| File types | PDFs, Pages, Keynote, Numbers only | Any | Any | Any file or folder |
| Password strength | Depends on your password; cipher not shown in the dialog | AES-256, depends on your password | AES-256 with gpg, depends on your password | AES-256-GCM, PBKDF2 with 150,000 iterations |
| Steps for one file | 3 to 5 | 8, plus making a folder | 1 command, plus install | 2 to 3 (right-click, password) |
| Extra software | None | None | gpg needs installing | Finderlock app |
| Risk of losing the password | High, no recovery | High, no recovery | High, no recovery | High for the item password; keep it safe |
| Plain original left behind | Yes | Yes | Yes | Replaced by a placeholder when locked |
No method in the table has a back door. That is the point of encryption, and it is also the risk.
Why a zip password is the weaker choice
Zipping a file with a password feels like the obvious shortcut, but it is usually the weakest of these options. The classic zip -e command uses an older encryption scheme that is considered weak, and many zip tools leave file names visible. If you must use zip, there are ways to make the password mean something, covered in how to password protect a zip file on Mac. For a folder rather than a single file, see how to password protect a folder on Mac.
Do not lose the password, and back up carefully
Strong encryption means nobody can get the file back for you. Apple cannot, and neither can any app that is doing its job. If you forget the password, treat the file as gone.
- Save the password in a password manager before you encrypt, not after.
- Test opening the encrypted copy before you delete anything.
- Back up the encrypted copy only. A backup that includes the plaintext original defeats the purpose, so check that no unencrypted copies are sitting in Downloads, a synced folder or another backup.
- Use a long passphrase, not a short word with a number on the end.
FAQ
Can I encrypt a single file on a Mac without any software?
Yes, for some file types. Preview can encrypt PDFs and Pages, Keynote and Numbers can set a password on their own documents. For other file types, an encrypted disk image from Disk Utility works with no extra software.
Does FileVault encrypt individual files?
Not in a way you control. It encrypts the whole disk, so files are protected when the Mac is off or logged out. Once you are logged in, your files are readable, and a copy sent elsewhere is not encrypted.
Is a password-protected zip file secure?
It is weaker than the other options here. The standard zip password scheme is dated, and a weak password makes it worse. Use a disk image, gpg or an app like Finderlock if the contents matter.
What happens if I forget the password?
You lose access to the file. There is no reset for a properly encrypted file. Keep the password in a password manager and keep a backup of the encrypted copy.
How do I encrypt a file on a Mac for emailing?
Password-protect it with Preview or iWork if it is a PDF or iWork document, or encrypt it with gpg or an encrypted image for other types. Send the password through a different channel than the email itself.
Next step
If you only have a PDF or a Pages file, use Method 1 today and keep the password in a password manager. If you have mixed file types or protect files often, try Finderlock: the free plan covers 3 protected items, so you can test right-click Protect on real files. To compare other tools first, read our roundup of the best Mac encryption apps.