How to hide files on a Mac (and really protect them)
By the Coffer team · Updated
Short answer: the quickest way to hide a file on a Mac is the Terminal command chflags hidden, or starting its name with a dot. Both only hide the file from Finder. They do not encrypt it, so anyone at your Mac can bring it back with Command + Shift + Period. To make a file truly private, encrypt it: with an encrypted disk image, or with a vault app like Coffer.
The traditional ways to hide a file on a Mac
macOS has three long-standing tricks. They all do the same thing: they tell Finder not to list the item.
Method 1: start the name with a dot
Any file or folder whose name begins with a period, like .taxes, is hidden in Finder. Renaming it in Finder is awkward because macOS warns you, so people usually do it in Terminal:
mv ~/Documents/taxes ~/Documents/.taxesMethod 2: the hidden flag (chflags)
This keeps the name unchanged and sets a flag instead:
chflags hidden ~/Documents/taxesTo undo it later: chflags nohidden ~/Documents/taxes. Tip: type chflags hidden and drag the file into the Terminal window to fill in the path.
Method 3: show and hide hidden items in Finder
Press Command + Shift + Period in any Finder window. Hidden items appear faded; press it again to hide them. This does not hide a new file, it only toggles whether already-hidden items are shown. It is also how anyone else finds them.
Why hiding a file is not the same as protecting it
- Nothing is encrypted. The contents are stored in plain form. Anyone who can open the file path, or boot the disk, can read it.
- One shortcut reveals it. Command + Shift + Period, or
ls -ain Terminal, lists hidden items. - Backups copy it as is. Time Machine and cloud backups store the readable file.
If the goal is only to keep Finder tidy, hiding is fine. For passports, tax papers, private photos, recovery phrases or API keys, you want encryption.
Built-in ways to really protect files on a Mac
Encrypted disk image (Disk Utility)
The best free option for a folder of files. It creates a password-protected container that behaves like a drive.
- Open Disk Utility, then choose File → New Image → Image from Folder.
- Pick the folder, set Encryption to 256-bit AES and choose a password.
- Set Image Format to read/write so you can add files later, then save the
.dmg. - Delete the original folder. Double-click the image and enter the password whenever you need the files, and eject it when you are done.
The catch: while the image is mounted, everything inside is open to anyone at your Mac, and you have to remember to eject it. The whole container must be unlocked to see a single file.
FileVault
FileVault (System Settings → Privacy & Security) encrypts the entire startup disk. It is excellent if your Mac is lost or stolen. It does not hide or lock individual files from someone using your Mac while you are logged in.
Photos Hidden album and locked Notes
For photos, hide them in the Photos app and they move to the Hidden album, which recent macOS versions lock with your password or Touch ID. Apple Notes can lock individual notes. Both are handy but limited to photos and notes.
The Coffer way: one place, locked with a passphrase or Touch ID
Coffer is a vault app for Mac. Instead of hiding files, it encrypts them (Argon2id for the passphrase, XChaCha20-Poly1305 for every file) and keeps them in a single vault on your own Mac. No account, no cloud.
- Create your vault. Open Coffer and choose a passphrase only you know. You also get a recovery phrase to keep somewhere safe.
- Add your files. Drag files and folders into the window, or use Import. Folders keep their structure.
- Open them in place. Photos, videos, PDFs and Office files preview inside Coffer, decrypted in memory and not written back to your disk as a readable copy.
- Lock with one shortcut. Press ⌘⇧L (changeable in Settings) and the vault locks and hides. It also locks when your Mac sleeps and after the idle time you choose. Unlock with Touch ID or your passphrase.
- Remove the originals. Once everything is in the vault, delete the unencrypted copies so only the encrypted ones remain.
Coffer also keeps secrets that don't fit a Finder folder: API keys, .env files, SSH keys and seed phrases, with optional expiry reminders. You can try it free for 7 days. Download Coffer or see what it does.
Hiding vs. encrypting: side by side
| Hidden flag / dot name | Encrypted disk image | FileVault | Photos Hidden album | Coffer | |
|---|---|---|---|---|---|
| Contents encrypted | No | Yes (AES) | Yes, whole disk | Locked album | Yes, every file |
| Protects against someone at your unlocked Mac | No | Only while ejected | No | Yes, while locked | Yes, while locked |
| Opens one file without unlocking everything | n/a | No, mounts the whole image | n/a | Yes | Yes |
| Works for any file type | Yes | Yes | Yes | Photos and videos | Yes |
| Holds API keys, .env files, seed phrases | As plain files | As files | As files | No | Yes, with expiry reminders |
| Cost | Free | Free | Free | Free | 7-day free trial, then one-time |
These are not rivals: FileVault is a good base layer for every Mac, and many people use it together with a vault for the files that matter most.
Frequently asked questions
What is the fastest way to hide a file on a Mac?
Open Terminal and run chflags hidden followed by the file or folder (drag it into the window to fill in the path). Finder stops showing it. It is still readable by anyone who knows to look, so use it for tidiness, not privacy.
How do I unhide a file on a Mac?
In Finder press Command + Shift + Period to show hidden items, or run chflags nohidden followed by the path in Terminal to remove the hidden flag for good.
Is a hidden file on a Mac safe from other people?
No. A hidden file is not encrypted. Anyone using your unlocked Mac can show it with one shortcut, and it is copied in readable form to backups. Encryption is what makes a file private.
What is the best way to password protect a folder on a Mac?
Put it in an encrypted disk image (built into macOS) or in an encrypted vault app such as Coffer. macOS has no setting that simply puts a password on a normal Finder folder.
Does FileVault hide or lock individual files?
No. FileVault encrypts the whole startup disk, which protects your data if the Mac is lost or stolen while off. Once you are logged in, your files are open like normal, so it does not hide anything from someone at your unlocked Mac.
Can I hide photos on a Mac?
Yes. In the Photos app you can hide a photo (it moves to the Hidden album, which is locked behind your password or Touch ID in recent macOS versions). It only covers photos and videos in your Photos library.