NOMEDIA File Documentation


Summary

A .nomedia file is an empty marker file on Android. When a folder contains a file named exactly .nomedia, Android’s media scanner skips that folder and all its subfolders, so photos, videos and music stored there stop appearing in the Gallery and music apps. There is nothing to open: the file is 0 bytes, with no content and no signature (its MIME type is reported as application/octet-stream). To make hidden media visible again, delete the .nomedia file and let the device rescan.

Technical details

FeatureValue
Full nameAndroid No-Media Marker File
Full file name.nomedia (the leading dot is part of the name)
MIME typeapplication/octet-stream
Format typeEmpty marker file (0 bytes) — only its name and location matter
DeveloperGoogle (Android Open Source Project)
Introducedcirca 2009 (early Android releases)
File size0 bytes by design
Magic numberNone — the file is empty
Consumed byAndroid media scanner (MediaStore), not by any app you open
EffectExcludes its folder and all subfolders from media indexing
Created byWhatsApp, Telegram, games and map apps; or users, to hide a folder
Typical locationCache, sticker, voice-note, map-tile and private photo folders
Safe to deleteYes — media reappears after a rescan; only caches may re-flood Gallery
Hides files fromGallery/music apps only — not from file managers (concealment, not security)
Related extensions.nomedia
Specification URLdeveloper.android.com/training/data-storage/shared/media

What is a .nomedia file?

A .nomedia file is not a document format. It is a marker: an empty, 0-byte file whose only job is its name and location. The convention comes from Android, created by Google as part of the Android Open Source Project, and it has existed since the early releases around 2009. When Android’s media scanner (the component behind MediaStore) encounters a folder containing a file named exactly .nomedia, it excludes that folder and everything beneath it from media indexing. Photos, videos and audio in that folder still exist and are untouched; they simply stop appearing in the Gallery, in music players and anywhere else that reads the media index.

The leading dot is part of the file name, not an extension in the usual sense. On Linux-style filesystems a leading dot also marks a file as hidden, which is why .nomedia often does not show up until you enable “show hidden files” in a file manager.

How the media scanner reads the marker

Android does not open or parse a .nomedia file, because there is nothing inside to read. The scanner works purely on presence: while walking the directory tree it checks each folder for a file called .nomedia, and if one exists it prunes that entire branch from indexing. This is why the effect is recursive: placing a single marker at the top of a folder hides media in all of its subfolders too. Because the rule is name-based, an empty file is enough, and its content, timestamp and size are irrelevant.

Which apps create .nomedia files, and why

Many apps drop a .nomedia file on purpose to keep their working files out of your Gallery. WhatsApp and Telegram place them in sticker, profile-thumbnail, voice-note and status-cache folders so that thousands of small images and clips do not flood the photo grid. Navigation and game apps use them to keep downloaded map tiles and texture atlases out of music and photo apps. Users also create .nomedia files by hand to hide a private folder of pictures from the Gallery. That last use is worth understanding precisely: the media becomes invisible to Gallery apps but stays fully visible to any file manager, so it is concealment, not protection.

Making hidden media visible again

Because the marker only suppresses indexing, removing it restores everything. Open a file manager that can show hidden files (for example Files by Google with “Show hidden files” enabled, or Total Commander), navigate to the affected folder, and delete the .nomedia file. Then trigger a rescan: rebooting the phone forces the media scanner to re-index storage, and adding or copying a file into the folder can also prompt it. The photos and videos reappear in the Gallery once the scan finishes. On Windows over USB the file is visible in Explorer and can be deleted there, though to create one you must save the name in quotes (".nomedia") because Explorer will not accept a file that appears to have no name.

Is a .nomedia file safe, and can I delete it?

It is harmless. The file is empty, so it cannot contain code and is not a virus, no matter how alarming a 0 KB file appearing next to your photos looks. Deleting any .nomedia file is always safe for your data; the only side effect is that app caches (stickers, thumbnails, voice notes) may start showing up in the Gallery again if you remove the marker from a cache folder. A common scare comes from “cleaner” or junk apps that create a .nomedia in a photo folder such as DCIM or Pictures, making it look as though your photos were deleted when they were only hidden from indexing. Deleting the marker and rescanning undoes that immediately.

The marker under scoped storage

Since Android 10 introduced scoped storage, apps increasingly rely on MediaStore flags to control what is indexed, rather than dropping marker files. The .nomedia convention still works for shared-storage folders, which is why users and messenger apps continue to encounter and use it, but it is now one mechanism among several rather than the only one.

References