How to Hide a Folder on a Mac

The simplest way to hide a folder on a Mac is with Terminal. Open Terminal (in Applications > Utilities), type chflags hidden followed by a space, drag the folder into the Terminal window to add its path, and press Return. The folder disappears from Finder. To see it again, press Command + Shift + . (period) in Finder to show hidden items, or run chflags nohidden on the folder to unhide it permanently.

Keep in mind that hiding isn’t the same as protecting. Anyone who knows the shortcut can see hidden folders. For real privacy, put the files in a password-protected encrypted disk image, covered below.

Your options at a glance

Method Privacy level Best for
Terminal chflags hidden Low: out of sight Decluttering or keeping a folder out of casual view
Rename with a leading period Low Quick hiding, but it can confuse some apps
Encrypted disk image High: password required Private documents
Separate user account High Sharing a Mac with family or roommates

Method 1: Hide a folder with Terminal

  1. Open Terminal from Applications > Utilities, or press Command + Space and type “Terminal.”
  2. Type chflags hidden and a space. Don’t press Return yet.
  3. Drag the folder from Finder into the Terminal window. Its path appears automatically.
  4. Press Return.
Mac Terminal window showing the chflags hidden command followed by a folder path
(1) Type chflags hidden, then drag the folder in to add its path. (Illustration)

If a folder name has spaces, dragging it in adds backslashes automatically, so the path works.

How to see and unhide the folder

  • Show hidden items temporarily: In Finder, press Command + Shift + . Hidden folders appear dimmed. Press it again to hide them.
  • Open it without showing all hidden items: In Finder, press Command + Shift + G, type the folder’s path, and press Return.
  • Unhide permanently: In Terminal, type chflags nohidden and a space, drag the folder in (show hidden items first), and press Return.

Method 2: Rename with a period

macOS hides items whose names start with a period. Finder won’t let you add one directly, so use Terminal: mv ~/Documents/Private ~/Documents/.Private. Rename it back the same way. This works, but some apps and backups treat dot-files differently, so Method 1 is usually better.

Method 3: Password-protect with an encrypted disk image

  1. Open Disk Utility from Applications > Utilities.
  2. Choose File > New Image > Image from Folder and select your folder.
  3. Set Encryption to 128-bit AES (or 256-bit), and enter a strong password. Don’t check “Remember password in my keychain” if you want to be asked every time.
  4. Set Image Format to read/write so you can add files later, and click Save.
  5. Check that the image opens with your password, then delete the original folder and empty the Trash.

Double-click the .dmg file and enter the password to open it. Eject it when you’re done. If you forget the password, the files can’t be recovered.

Method 4: Use a separate user account

Each macOS user account has its own private Home folder that other standard users can’t open. Set one up in System Settings > Users & Groups > Add User.

Frequently asked questions

Will hidden folders show up in Spotlight?

Often, yes. To keep a folder out of Spotlight results, add it in System Settings > Spotlight > Search Privacy (named Privacy in older versions).

Are hidden folders backed up by Time Machine?

Yes. Hidden folders are still backed up.

Can I hide a folder on my Mac’s Desktop?

Yes. Use the same chflags method. The folder disappears from the Desktop but stays in place.

How do I hide folders on Windows?

Right-click the folder, choose Properties, and check Hidden. See how to unhide folders in Windows 11 to reverse it.

Categories Mac