You can hide photos from the gallery on Android without installing anything by putting them in a folder that contains an empty file named .nomedia, or in a folder whose name starts with a dot (for example .private). Android's media scanner skips those folders, so gallery apps that read from Android's media list stop showing the photos. Two limits matter. First, it doesn't work in Android's standard top-level folders such as DCIM, Pictures or Download, or in DCIM/Camera; use a subfolder or a new folder. Second, this only hides photos from gallery apps. The files are not locked or encrypted, and any file manager or computer can still open them. For locked and encrypted options, see how to hide photos on Android.
How .nomedia works
Android keeps an index of the photos, videos and audio on your phone's shared storage, called the media store. Android's developer documentation describes it as an index that lets apps find and update these media files. Gallery apps that rely on it show what it lists, so a folder it skips drops out of their view.
Android's developer reference defines .nomedia as the name of the file "signaling the media scanner to ignore media in the containing directory and its subdirectories." It was meant for apps, so their icons and sound effects don't show up in your gallery or music app. It works just as well for your own folder.
In Android's current media provider source code (the part of Android that builds the media store), a folder counts as hidden when either of these is true:
- its name starts with a dot, or
- it contains a file named
.nomedia.
Everything inside a hidden folder, including its subfolders, is treated as hidden too.
Where .nomedia does not work
This is the detail most how-tos leave out. Android's media provider source code deliberately ignores, and deletes, a .nomedia file placed in:
| Folder | Does .nomedia hide it? |
|---|---|
| A standard top-level folder: DCIM, Pictures, Movies, Download, Documents, Music and the other standard ones | No. The file is removed and the folder stays visible |
| DCIM/Camera | No |
| A Screenshots folder at the top level or directly inside a standard folder (for example Pictures/Screenshots) | No |
| A subfolder inside a standard folder (for example Pictures/Private) | Yes |
| A new folder at the top of storage with your own name (for example /Private) | Yes |
| Any folder whose name starts with a dot | Yes, with or without a .nomedia file |
So putting .nomedia straight into DCIM to hide your camera photos does nothing on current Android. Your photos need to move into a folder of their own first.
Phone makers can change parts of Android, and gallery apps can read storage in their own way, so test the result on your own phone.
How to hide photos from the gallery with .nomedia
You need a file manager that can create folders and files, or a computer and a USB cable. Menu names differ between file manager apps and phone models, so the steps below describe what to do rather than exact buttons.
On the phone
- Open your file manager and go to internal storage.
- Create a new folder, either at the top level or inside Pictures (for example
Pictures/Private). Don't use DCIM/Camera. - Inside that folder, create an empty file named exactly
.nomedia(dot at the start, no extension). If your file manager can't create an empty file, create a folder named with a dot instead, for examplePictures/.private. - Move the photos into the folder.
- Open your gallery app. If the photos still appear, close the app and open it again, or restart the phone. The media store updates on its own schedule.
With a computer
- Connect the phone by USB and choose file transfer on the phone.
- On the computer, open the phone's internal storage and create the folder.
- Create an empty text file inside it and rename it to
.nomedia. Make sure the computer doesn't add.txtto the end. - Move the photos into the folder.
To undo it
Delete the .nomedia file, or rename the dot folder so its name no longer starts with a dot. The photos come back into the gallery after the media store updates.
What .nomedia doesn't do
Be clear about this before you rely on it.
| Who or what | Can they still see the photos? |
|---|---|
| Your gallery app | Usually not |
| Someone browsing in a file manager | Yes, by opening the folder. A dot folder may not be listed by default, but a file manager set to show hidden items lists it |
| A computer connected over USB to the unlocked phone | Yes |
| Apps with all-files access | Yes |
| A cloud backup made before you moved the photos | Yes, the cloud copy stays |
| The trash or recycle bin of the gallery app | Yes, if you deleted copies there |
Nothing is encrypted and there is no password. If someone knows, or guesses, that a folder called "Private" exists, it takes seconds to open. That is why we describe this as hiding, not protection. Our page on hidden vs encrypted photos explains the difference in more depth.
When .nomedia makes sense
Good for:
- Keeping work screenshots, receipts or memes out of the main gallery so it stays tidy
- Stopping certain pictures from appearing in "memories" style slideshows that read from the gallery
- Low-stakes privacy, such as photos you'd rather not have pop up when you show someone your holiday album
Not good for:
- Photos that would cause real harm if seen
- A phone you often hand to children, friends or a repair shop (see hiding photos when you hand your phone to someone)
- Anything you need protected if the phone is lost
Common mistakes
- Putting .nomedia in DCIM or DCIM/Camera. Current Android removes it. Use a separate folder.
- Naming the file
nomediaor.nomedia.txt. The name must be exactly.nomedia. - Forgetting the cloud. If Google Photos backup was on, the photos may already be in your Google account. See deleting the originals after hiding photos.
- Forgetting where the folder is. A dot folder can also hide itself from you. Our page on finding hidden photos on your own phone shows where to look.
- Assuming other apps can't see it. An app that can browse all files can still open it.
Built-in options that lock photos instead
If you want a password on the photos and not just a hidden folder, these exist on many phones already:
- Google Photos Locked Folder: opens with your screen lock; Google says items in it aren't available to other apps that can access photos and videos.
- Samsung Secure Folder or Private album: see how to hide photos on Samsung.
- Xiaomi Gallery Private album: opens with a privacy password.
A vault app such as HideBerry goes a step further: it encrypts each photo on the phone, behind its own PIN or pattern, with no account. How HideBerry works explains the setup and backups. It has limits too: someone with your unlocked phone can try to guess your PIN (waits slow this down), and it can't protect copies you take out or originals left in the gallery or the cloud.
People Also Ask
Does .nomedia delete photos? No. It only tells Android's media scanner to skip that folder. The files stay exactly where they are. Delete the .nomedia file and the photos return to the gallery.
Does .nomedia hide videos too? Yes. The media scanner skips all media in that folder, including videos and audio. For locked video options, see how to hide videos on Android.
Will Google Photos back up a .nomedia folder? Google's help pages don't say how backup treats a folder the media store skips, so don't count on it either way. Photos backed up before you moved them are already in your account.
Is a dot folder the same as .nomedia? For the media store, yes: Android's media provider treats both as hidden. The difference is that some file managers also leave dot folders out of their own list until you choose to show hidden items, which can make the folder harder for you to find later.
FAQs
How do I create a .nomedia file on Android?
Open a file manager, go to the folder you want to hide, and create a new empty file named exactly .nomedia. If your file manager can only create folders, name a folder with a dot at the start instead, such as .private, and move the photos into it. A computer over USB also works.
Why does .nomedia not work in my DCIM folder?
Android's media provider deliberately ignores a .nomedia file in its standard top-level folders (DCIM, Pictures, Download, Movies and others) and in DCIM/Camera, and removes it. Make a separate folder, such as Pictures/Private, and put the .nomedia file and the photos there.
Do I need root to use .nomedia?
No. Any file manager that can create a file or a folder in your phone's shared storage can do it, and so can a computer over USB.
Is .nomedia safe for my photos?
It doesn't change or delete them, so your photos are safe from loss in that sense. It just isn't privacy protection. Keep a backup of anything you care about, as you would with any folder.
Choose the level of privacy your photos need
A .nomedia folder is fine for keeping clutter out of the gallery. For photos that need a lock and encryption, HideBerry, coming soon to Google Play, keeps them encrypted on the phone with no account and no cloud. Read how HideBerry works to see whether it fits.
Sources
- MediaStore: MEDIA_IGNORE_FILENAME, Android Developers
- Access media files from shared storage, Android Developers
- MediaProvider FileUtils.java (isDirectoryHidden), Android Open Source Project
- Hide sensitive photos & videos in Locked Folders, Google Photos Help
- How to find pictures in private album?, Xiaomi