What is the NOMEDIA file format?
Files with the .nomedia extension do not contain any data - they are always exactly 0 bytes - and they carry no filename prefix. It is a hidden file (the leading dot conceals it in standard Android and Linux file listings) that informs the Android media scanner that the directory in which it is located does not hold multimedia files that should be displayed, such as images, videos, or audio.
.nomedia files are used to hide the contents of directories so that they are not visible to media-aware apps - for instance, the system gallery or a music player. Placing one inside a folder prevents those apps from indexing and displaying its media. Removing the .nomedia file causes the media scanner to re-index the directory on its next pass.
The marker was introduced by Google as part of the Android Open Source Project (AOSP) in the early Android releases around 2009 and has been part of the platform ever since. It applies to the folder it resides in but does not cascade into subdirectories - each subfolder that should be excluded needs its own .nomedia file.
If you want to create such a file manually, you must remember that the filename prefix is supposed to be left empty. The file should contain only the extension - it should be named exactly .nomedia. On Android or Linux, the shell command touch .nomedia is all that is needed; alternatively, any file manager can create an empty file with that name.
The file will not serve its purpose if named with any prefix - for example, file.nomedia is not recognized by the media scanner.
Security & safety
RISK: LOWA .nomedia file is harmless - it is empty and cannot contain code. It is not a virus, although some 'cleaner' or junk apps create .nomedia files in DCIM/Pictures and make users think their photos were deleted. Deleting any .nomedia file is always safe for your data; the only side effect is that app caches (stickers, thumbnails) may flood your Gallery again. Note: hiding photos with .nomedia is not security - any file manager still shows the media.
Format details
in a nutshellPrograms that open NOMEDIA files
Technical details
deep spec| File size | Always 0 bytes - the file is empty by design; its content is irrelevant |
| Full filename | `.nomedia` - dot-prefixed with no stem; the leading dot is part of the name, not a separator |
| File content | Empty - no bytes, no headers, no magic signature; only the filename and its location matter |
| Visibility | Hidden on Android and Linux by convention - dot-prefixed files are not shown in standard directory listings |
| Scope | Applies only to the directory it resides in; does not cascade into subdirectories |
| Recognized by | Android MediaStore media scanner (AOSP), which checks for this file before indexing a folder |
| Effect on media scanner | Suppresses indexing of images, audio, and video in the marked directory |
| Developer | Google / Android Open Source Project (AOSP) |
| Introduced | Circa 2009, in early Android releases |
| Storage support | Works on both internal storage and external SD card directories on Android |
| Case sensitivity | Filename must be lowercase `.nomedia` - Android's filesystem is case-sensitive; `.NOMEDIA` or mixed-case variants are not recognized |
| MIME type | `application/octet-stream` - no content for type detection |
| Creation method | Any file manager or the shell command `touch .nomedia` can create it as an empty file |
| Removal effect | Deleting the file causes the next media scanner pass to re-index and expose the directory's media |
| Platform specificity | Android-only convention; has no effect on Windows, macOS, or iOS file systems |
| Prefix requirement | Must have an empty stem - any filename prefix (e.g., `app.nomedia`) breaks recognition by the media scanner |
| Released | circa 2009 (early Android releases; behavior documented in Android MediaStore/media scanner) |
| Open standard | Yes · royalty-free |
| Specification | developer.android.com |