.SDF

SDF File

SQL Server Compact Database File
Ask a question
QUICK ANSWER

An .sdf file is most commonly a Microsoft SQL Server Compact (SQL CE) database - a single binary file that a Windows or .NET app uses to store its data. Open it with free tools like CompactView or SQL Server Compact Toolbox; a text editor shows only gibberish. SQL CE reached end of support in 2021, so most .sdf files today are legacy data from older applications.

Developer: Microsoft Corporation Category: Database Files MIME: application/octet-stream
OPENS ON Windows
Related: .DB · .DBF · .ACCDB · .SQL

On this page

19k+ extensions indexed
Last reviewed Jul 13, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

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: LOW

A .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
FULL NAMESQL Server Compact Database File
DEVELOPERMicrosoft Corporationsince 2005 (SQL Server Mobile / Compact Edition); last release SQL CE 4.0, 2011
MIME TYPEapplication/octet-stream
TYPESingle-file embedded relational database (binary, up to 4 GB)
This extension is also used by…
  • 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

Windows5 apps
CompactView Open-source Open the .sdf to browse tables and run queries read-only - free, no SQL CE install needed. Best first choice for just reading a legacy .sdf.
SDF Viewer Paid Open the .sdf to view/edit data and export to CSV/XML/XLS. Actively maintained (updated 2026); good when you need to extract data.
SQL Server Compact Toolbox (ErikEJ) Open-source Open the .sdf in the standalone tool or Visual Studio add-in to browse, query, script and migrate it to SQLite/SQL Server.
Microsoft SQL Server (Management Studio) Free Older SSMS versions could connect to SQL CE .sdf databases; modern SSMS dropped SQL CE support, so prefer the Toolbox/CompactView for legacy files.
Full Convert (Spectral Core) Paid Open the .sdf as a source and copy its tables/data into another database (SQLite, MySQL, SQL Server, etc.).

Technical details

deep spec
DeveloperMicrosoft Corporation
Engine typeEmbedded relational (serverless, in-process)
Maximum database size4 GB per `.sdf` file
Data modelRelational (tables, indexes, views, foreign keys)
SQL dialectTransact-SQL (T-SQL) subset
Storage formatBinary page-based, non-human-readable
MIME typeapplication/octet-stream
Platform supportWindows only (.NET Framework desktop and mobile apps)
Runtime dependencySQL CE engine DLLs (`sqlcese40.dll`, `sqlceqp40.dll`)
Transaction supportACID-compliant transactions
EncryptionOptional AES 128-bit password encryption
Maximum row size8 060 bytes
Unicode supportFull Unicode via `nchar` / `nvarchar` column types
Magic bytesNo published magic number; identified by file extension and SQL CE application context
Released2005 (SQL Server Mobile / Compact Edition); last release SQL CE 4.0, 2011
Specificationen.wikipedia.org

SDF conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with SDF files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about SDF files.

Frequently asked questions

How do I open a .sdf file?
If it's a SQL Server Compact database (the common case), use a free tool like CompactView or SQL Server Compact Toolbox to browse the tables, or SDF Viewer to view/export data. Don't use a text editor - it's a binary database.
Why does my .sdf look like random characters in Notepad?
Because the SQL CE .sdf is a binary database, not text. Open it with a database viewer (CompactView, SDF Viewer, SQL Server Compact Toolbox) instead.
Is SQL Server Compact still supported?
No. Extended support for SQL CE 4.0 ended on July 13, 2021, and there's no successor. Existing .sdf files still open in third-party tools; Microsoft recommends migrating data to SQLite or LocalDB.
How do I convert a .sdf database to Excel/CSV?
Open it in SDF Viewer or SQL Server Compact Toolbox and export each table to CSV or XLS, then open that in Excel. There's no one-click whole-database-to-Excel conversion.
Is every .sdf file a database?
No. The same extension is also used by a plain-text chemical Structure-Data File (molecule data) and by some spatial/export tools. Open it as text first: if it's readable chemistry/text it's not the SQL CE database.
Can I recover data from an old app's .sdf?
Usually yes - copy the .sdf and open it with CompactView or the SQL Server Compact Toolbox to read the tables, then export to CSV/SQLite. If it's password-protected you'll need the app's database password.

References

1Wikipedia - SQL Server Compact (history, EOL 2021)en.wikipedia.org
2Microsoft Learn - SQL Server Compact support lifecyclelearn.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.BINCD/DVD Disc Image (BIN/CUE)
7.RPMSGRestricted Permission Message
8.NOMEDIAAndroid No-Media Marker File
9.MDMarkdown Document
10.TXTPlain Text File

Related extensions

.DBSQLite Database File
.DBFDatabase File (dBASE / xBase table)
.ACCDBMicrosoft Access Database (2007+)
.SQLSQL Script (Structured Query Language source / database dump)
.MDBMicrosoft Access Database (97-2003, Jet engine)
.FDBFirebird Database

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z