The simplest way: use the built-in encryption tool
macOS includes a native encryption feature called FileVault that protects your entire drive, but if you want to lock individual files instead, the fastest method is to compress them into a password-protected ZIP archive. This works for any file type — documents, photos, spreadsheets, folders — and requires no additional software.
The process takes about two minutes. You right-click the file, choose "Compress," and then set a password on the resulting ZIP file using a built-in utility. The original file stays unencrypted on your drive, but the compressed version is locked. Once you send or store the ZIP, anyone who tries to open it will need your password.
Key Takeaways
- The fastest method is to compress a file into a password-protected ZIP archive using macOS's built-in Archive Utility, which works with any file type.
- You can password-protect a folder by compressing it first, then setting a password on the resulting ZIP file through the command line or a third-party tool.
- FileVault encrypts your entire drive automatically, but it does not let you lock individual files with separate passwords.
- Third-party apps like Keka or The Unarchiver offer more control over compression and encryption if you need to password-protect files regularly.
- Password-protected ZIPs work across Mac, Windows, and Linux, so recipients on any device can open them with the correct password.
Step-by-step: compress and password-protect a single file
Open Finder and locate the file you want to protect. Right-click it and select "Compress [filename]" from the menu. macOS will create a new ZIP file in the same folder with the same name plus ".zip" at the end. The original file remains unchanged.
Now open Terminal, which you can find by pressing Command+Space, typing "Terminal," and pressing Enter. In Terminal, type this command exactly: ditto -c -k --sequesterRsrc --keepParent /path/to/your/file.zip /path/to/your/encrypted.zip. Replace the paths with the actual location of your ZIP file. When you press Enter, Terminal will ask you to enter a password twice. Type carefully — you will not see the characters as you type.
Once the command finishes, you now have an encrypted ZIP file. The original unencrypted ZIP can be deleted. Anyone who tries to open the encrypted ZIP will be prompted for the password you just set.
Protecting a folder with multiple files inside
If you need to lock an entire folder, the process is the same as a single file. Right-click the folder in Finder, select "Compress," and macOS will create a ZIP archive of the whole folder. Then use the Terminal command above to add password protection to that ZIP.
This is useful when you have a project folder with many documents, images, or spreadsheets that you want to keep together and locked. The recipient will need to enter the password once to extract the entire folder, and then all files inside will be accessible.
Why FileVault is not the answer for individual files
FileVault is macOS's full-disk encryption feature, and it is enabled by default on newer Macs. It encrypts everything on your drive, which is excellent for security if your Mac is stolen. However, FileVault does not let you password-protect individual files with separate passwords — it encrypts the whole drive with one key.
If you want to lock specific files while leaving others accessible, or if you want to send a password-protected file to someone else, FileVault will not help. That is why the ZIP compression method is the right tool for this task.
Using third-party apps for more control
If you password-protect files regularly, a dedicated compression app may save time. Keka is a free tool that lets you drag files onto it, choose your compression format, and set a password all in one window. The Unarchiver is another free option that handles password-protected archives and can create them as well.
These apps are optional — the Terminal method works perfectly and costs nothing — but they remove the need to remember command syntax. read either from the Mac App Store or the developer's website, then drag your file onto the app icon to start the process.
What happens when someone opens your password-protected file
When a recipient tries to open a password-protected ZIP on their Mac, Windows computer, or Linux machine, the operating system will automatically prompt them for the password before extracting the contents. They type the password, and if it is correct, the files inside are extracted to their chosen location.
If they enter the wrong password, the extraction fails and they are asked to try again. There is no way to bypass the password or recover it if forgotten, so make sure you share the password through a separate channel — never in the same message as the file itself.
Frequently Asked Questions
Can I password-protect a file without compressing it into a ZIP?
Not with macOS's built-in tools. Compression into a ZIP is the native method. Some third-party apps like Encrypto offer password protection without compression, but they are not part of macOS and require installation. For most users, the ZIP method is the simplest and most compatible option.
What if I forget the password I set?
There is no recovery method. The password cannot be reset or bypassed. If you forget it, the file is locked permanently. Write down your password in a find location, or use a password manager to store it before you send the file to anyone.
Will the recipient be able to see the original filename inside the ZIP?
Yes. The ZIP archive itself is password-protected, but once someone enters the correct password and extracts it, they will see all the original filenames and folder structure inside. The password only protects access to the contents, not the names of the files.
Can I password-protect a file that is already on my Mac and keep it in place?
Not easily. The compression method creates a new ZIP file, leaving the original unencrypted. You would need to delete the original after confirming the ZIP works. If you want to encrypt files in place on your drive, FileVault is the right tool, but it encrypts your entire drive, not individual files.
Does password-protecting a ZIP file work on Windows or Linux?
Yes. A password-protected ZIP created on a Mac can be opened on Windows, Linux, or any other operating system that supports ZIP archives. The recipient will be prompted for the password regardless of their device.