Skip to content
Coffer
Try free
Guide

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/.taxes

Method 2: the hidden flag (chflags)

This keeps the name unchanged and sets a flag instead:

chflags hidden ~/Documents/taxes

To 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

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.

  1. Open Disk Utility, then choose File → New Image → Image from Folder.
  2. Pick the folder, set Encryption to 256-bit AES and choose a password.
  3. Set Image Format to read/write so you can add files later, then save the .dmg.
  4. 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.

  1. Create your vault. Open Coffer and choose a passphrase only you know. You also get a recovery phrase to keep somewhere safe.
  2. Add your files. Drag files and folders into the window, or use Import. Folders keep their structure.
  3. 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.
  4. 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.
  5. 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 nameEncrypted disk imageFileVaultPhotos Hidden albumCoffer
Contents encryptedNoYes (AES)Yes, whole diskLocked albumYes, every file
Protects against someone at your unlocked MacNoOnly while ejectedNoYes, while lockedYes, while locked
Opens one file without unlocking everythingn/aNo, mounts the whole imagen/aYesYes
Works for any file typeYesYesYesPhotos and videosYes
Holds API keys, .env files, seed phrasesAs plain filesAs filesAs filesNoYes, with expiry reminders
CostFreeFreeFreeFree7-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.

zzz

Keep it private. Keep it on your Mac.

Download Coffer and try everything free for 7 days, no card and no account. Then pay once, from $9.

Checkout opens at launch

Coffer isn't on sale yet, so nothing was charged. Try it free for 7 days in the meantime: everything works, and you can buy as soon as checkout opens.

Try free for 7 days

Secure checkout by Dodo Payments. Prices in US dollars; taxes are added where they apply.