What is a .nomedia file? Hiding a folder from your gallery
How a .nomedia file keeps a folder out of your gallery and Google Photos, how to create one, the folders where Android ignores it, and why it isn’t privacy.
· 8 min read
A .nomedia file is an empty file that tells Android to leave the folder it's in out of the phone's media library. Put one in a folder, and the photos, videos and music inside stop showing up in your gallery, Google Photos and music apps. Here's how it works, how to make one, the folders where it won't work, and why it hides files without protecting them.
What a .nomedia file does
Android keeps a media library of every photo, video and song on your phone, so apps don't have to search your storage themselves. Your gallery, Google Photos, music players and the photo picker other apps use all read from it.
When Android finds a file named .nomedia in a folder, it treats that folder, and every folder inside it, as hidden. The files stay where they are, but the media library no longer lists them as photos, videos or music, so apps that rely on it stop showing them. Android treats a folder whose name starts with a dot the same way.
The file doesn't need anything in it. Only its name matters: a dot, then nomedia, with nothing before the dot and no extension after it.
What it doesn't do
A .nomedia file changes what Android lists, not the files themselves. They aren't moved, renamed or encrypted, so:
- Any file manager can still open them. Most file managers show the folder straight away, and those that hide dot-files show them with one setting.
- A computer sees everything. Connect the phone with a cable and the folder copies off like any other.
- Apps that read files directly still see them, including some galleries and backup tools.
- Google Photos skips them too. It finds photos through the same media library, so photos in a hidden folder don't get backed up. If the phone is lost, they go with it.
So it's a tidying tool, not a privacy one. Our guide to hidden vs encrypted explains the difference, and here's how to lock files and folders instead.
Folders where it won't work
Android ignores a .nomedia file in its standard folders, and deletes it. That includes the top-level DCIM, Pictures, Movies, Download, Documents and Music folders, the DCIM/Camera folder your camera saves to, and Screenshots folders. Your camera roll can't be hidden this way, so if you try it there, the file simply disappears.
It does work in a folder you make yourself, including one inside Pictures or DCIM, such as Pictures/Private.
How to create a .nomedia file
- Open a file manager and make a new folder for the photos you want out of the gallery, for example Pictures/Private.
- Inside that folder, create a new, empty file called exactly
.nomedia. If your file manager can't create files, copy any small file into the folder and rename it to.nomedia. Some file managers refuse names that start with a dot, and a different file manager usually allows it. - Move your photos into the folder.
Your gallery may take a little while, or a restart, to stop showing them. Searching for a ".nomedia file download"? There's nothing to download: any empty file with that exact name works, and a download from an unknown site could be anything.
A quicker trick does the same job: rename the folder so its name starts with a dot, like .Private. Many file managers then hide the folder itself too, until you turn on their show-hidden-files setting.
How to undo it
Turn on your file manager's show-hidden-files setting (on Samsung's My Files, it's called Show hidden system files), open the folder and delete the .nomedia file, or move the photos into a normal folder. They come back to your gallery once Android notices, which can take a restart.
Lost photos and suspect this is why? Our guide to finding hidden photos covers this and every other place they can be, and there's one just for Samsung phones.
Why apps use .nomedia files
Plenty of apps add .nomedia files for good reasons: to keep thumbnails, caches, game images and chat stickers out of your gallery. Vault apps use them too. The difference between a good vault and a weak one is what comes next: a weak vault stops at the .nomedia file and leaves your photos as ordinary files, while a good one encrypts every file as well.
How Hidey uses it
Hidey keeps your vault in a hidden folder called .hidey, with a .nomedia file, so galleries and the media library skip it. That's only the first layer. Every photo, video and file inside is encrypted on your phone with AES-256-GCM and saved under a meaningless name, so a file manager or a computer can find the folder but can't open anything in it. Because hidden folders also escape Google Photos backup, Hidey keeps its own: the vault backs up, encrypted, to a hidden folder in your own Google Drive. The trade-off to know: that backup also lets you reset a forgotten PIN through Google after a 24-hour wait, so whoever controls your Google account could reset it too, unless you turn on zero-knowledge mode (Pro). For the other ways to keep photos out of your gallery, see how to hide photos on Android.