What is the SDF file format?
An .sdf file is a SQL Server Compact Database file - a proprietary binary format developed by Microsoft. .sdf files are used for database storage in Windows desktop and mobile applications built on the .NET Framework. .sdf files store data in a structured binary page layout (not fixed-length text fields) and hold up to 4 GB of relational data in a single portable file.
SQL Server Compact (SQL CE), introduced in 2005, is a lightweight embedded database engine that runs in-process with an application without requiring a server - similar in concept to a SQLite database or a Microsoft Access database.
Many database migration and conversion tools support .sdf to facilitate importing and exporting data to other systems. .sdf files are not a general-purpose exchange format, however - they are tied to the SQL CE runtime and proprietary to Windows/.NET applications.
Note: .sdf is also used by the chemistry industry for Structure-Data Files (plain-text molecular data), an entirely separate format unrelated to SQL CE.
Security & safety
RISK: LOWA .sdf SQL CE database is data, not an executable, so opening it in a viewer is safe. Two practical cautions: SQL CE is unsupported since 2021, so treat .sdf files as legacy and keep backups before editing; and some .sdf files are password-encrypted, so a viewer may prompt for the database password. As always, only open .sdf files from sources you trust and watch for disguised double extensions (data.sdf.exe).
Format details
in a nutshell- Chemical Structure-Data File (MDL SDF) - Plain-text cheminformatics format (MDL/Symyx) storing molecule structures plus data fields, read by tools like Open Babel, RDKit and ChemDraw - unrelated to the SQL database .sdf.
- Generic 'Standard/Spatial Data File' - A few apps (e.g. Autodesk FDO / MapGuide, some GPS and survey tools) use .sdf for their own spatial or export data - app-specific, not the SQL CE database.
Programs that open SDF files
Technical details
deep spec| Developer | Microsoft Corporation |
| Engine type | Embedded relational (serverless, in-process) |
| Maximum database size | 4 GB per `.sdf` file |
| Data model | Relational (tables, indexes, views, foreign keys) |
| SQL dialect | Transact-SQL (T-SQL) subset |
| Storage format | Binary page-based, non-human-readable |
| MIME type | application/octet-stream |
| Platform support | Windows only (.NET Framework desktop and mobile apps) |
| Runtime dependency | SQL CE engine DLLs (`sqlcese40.dll`, `sqlceqp40.dll`) |
| Transaction support | ACID-compliant transactions |
| Encryption | Optional AES 128-bit password encryption |
| Maximum row size | 8 060 bytes |
| Unicode support | Full Unicode via `nchar` / `nvarchar` column types |
| Magic bytes | No published magic number; identified by file extension and SQL CE application context |
| Released | 2005 (SQL Server Mobile / Compact Edition); last release SQL CE 4.0, 2011 |
| Specification | en.wikipedia.org |
SDF conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about SDF files.