What is the DS_STORE file format?
A .DS_Store file stores viewing preferences for the folder in which it resides. It is a hidden file used by macOS, similar to the desktop.ini file used in Microsoft Windows. The file has no conventional extension - its full filename is literally .DS_Store, and the leading dot makes it invisible in Finder and on Unix-like systems. Internally, .DS_Store uses Apple's proprietary "Buddy" allocator binary format, identifiable by the magic signature Bud1 at offset 4.
Folder metadata that can be stored in .DS_Store files includes:
- Size and position of icons
- Window position relative to the screen
- Selected view (icon, list, column, or gallery)
- Background color or image set for the folder window
- Information used by other applications (macOS 10.4 and later), for example Spotlight
The name .DS_Store stands for Desktop Services Store. Files are created and updated automatically by Finder. A .DS_Store file can be safely deleted - doing so restores default folder settings, and Finder will automatically create a new one on the next folder access. The file is also created on removable storage devices such as USB drives. For remote file systems accessible from macOS, .DS_Store files are generated by default, but this behavior can be disabled via a Terminal command. .DS_Store files are also created inside compressed archives and will appear in unpacked folders even on other operating systems, though they serve no function there. Because they can inadvertently expose directory structure and metadata, many developers add .DS_Store to their .gitignore file.
Security & safety
RISK: LOWA .DS_Store is inert metadata and is not a virus - it contains no executable code, so opening or deleting one cannot harm your computer or your files. Deleting it is always safe; macOS just recreates it with default view settings. The one genuine concern is privacy/disclosure, not malware: a .DS_Store records the names of items that were in a folder, so a copy left in a public place (a web server's directory, a shared ZIP) can reveal filenames you didn't intend to expose. For that reason, strip .DS_Store files before publishing archives or deploying a website, and add them to .gitignore.
Format details
in a nutshellPrograms that open DS_STORE files
Technical details
deep spec| Full filename | `.DS_Store` - the leading dot is part of the name, not an extension separator; the file has no conventional extension |
| Internal format | Apple proprietary "Buddy" allocator / B-tree binary structure; undocumented by Apple and known only through reverse engineering |
| Magic bytes | `00 00 00 01 42 75 64 31` - first four bytes are `00 00 00 01`; bytes 4-7 spell `Bud1` (the Buddy allocator signature) |
| MIME type | `application/octet-stream` |
| Developer | Apple Inc. |
| Byte order | Big-endian |
| Hidden by default | Yes - the leading dot conceals the file in Finder and in Unix/Linux shells unless hidden files are explicitly shown |
| Created by | macOS Finder; generated and updated automatically and silently on folder access, without user interaction |
| Stored metadata | Icon sizes and positions, window geometry, selected view mode (icon / list / column / gallery), folder background image or color, Spotlight metadata (macOS 10.4+) |
| Network drive behavior | Generated on remote SMB/AFP volumes by default; suppressible with `defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true` |
| Deletion behavior | Safe to delete at any time; Finder recreates the file automatically on the next access to the same folder |
| Cross-platform behavior | Non-functional on Windows and Linux; appears in folder trees extracted from macOS-created archives but is ignored by those systems |
| Security implication | Can leak internal directory structure and file-path metadata if committed to version control repositories or distributed inside archives |
| Typical file size | A few hundred bytes to several KB, depending on the number of items and metadata entries stored for the folder |
| Documentation status | Officially undocumented by Apple; internal structure was reverse-engineered by third-party developers |
| Released | Mac OS X 10.0, 2001 (Desktop Services / Finder) |
| Specification | en.wikipedia.org |
DS_STORE conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DS_STORE files.