An MDF file is one of two very different things, so first figure out which you have. If it came with a matching .mds file or from a game or software download, it’s a disc image: mount it with a free virtual drive tool such as WinCDEmu, or convert it to ISO and open it in File Explorer. If it came from a database, app, or IT department, it’s a Microsoft SQL Server database: open it by attaching it in SQL Server Management Studio (Databases > right-click > Attach) with SQL Server or the free SQL Server Express installed.
Here’s how to tell the difference and open each type on Windows 10.
Which type of MDF file do you have?
| Clue | Disc image (Alcohol 120%) | SQL Server database |
|---|---|---|
| Companion file | .mds file with the same name | .ldf log file with a similar name |
| Typical source | Game, software, or CD/DVD backup | Business app, website backup, developer |
| Size | Often 600 MB to 8 GB (CD/DVD size) | Anything, often in a folder named DATA |
| How to open | Mount as a virtual drive or convert to ISO | Attach in SQL Server |
Opening an MDF disc image
Option 1: Mount it with a virtual drive tool
- Install a free mounting tool that supports MDF/MDS, such as WinCDEmu.
- Double-click the .mds or .mdf file, or right-click it and choose the tool’s Mount option.
- Open the new virtual drive in File Explorer > This PC.
- Run the setup file or copy what you need.
Windows 10 can mount ISO and IMG files by itself, but not MDF.
Option 2: Convert MDF to ISO
Many disc image tools can convert MDF to ISO. Once it’s an ISO, double-click it to mount it in Windows. See how to open an ISO file. Some protected discs don’t convert cleanly, so mounting the original is more reliable.
Download tools only from their official sites, and be cautious with disc images from unknown sources, since they can contain malware.
Opening an SQL Server MDF database
- Install SQL Server Express (free) and SQL Server Management Studio (SSMS) from Microsoft if you don’t have them. Use a SQL Server version that’s the same or newer than the one that created the file.
- Copy the MDF (and LDF, if you have it) into SQL Server’s DATA folder, or a folder the SQL Server service account can access.
- Open SSMS and connect to your server, such as (localdb) or .\SQLEXPRESS.
- In Object Explorer, right-click Databases and choose Attach.
- Click Add, select the MDF file, and click OK twice.

If you only have the MDF without its LDF, SSMS may show the log as “Not Found.” Remove the log entry in the Attach dialog, and SQL Server will try to create a new one. This works only if the database was shut down cleanly.
Alternative: Visual Studio or Azure Data Studio
Developers can also connect to an MDF with Visual Studio’s Server Explorer using LocalDB. Microsoft is retiring Azure Data Studio in favor of other tools, so SSMS is the safest choice.
Troubleshooting SQL MDF files
- “Access is denied”: Give the SQL Server service account permission to the folder, or move the files to the DATA folder.
- “The database cannot be opened because it is version X”: The file was created by a newer SQL Server. Install a newer version.
- Database shows as suspect or corrupt: Ask whoever gave you the file for a proper .bak backup, which is safer to restore.
Frequently asked questions
Can I open an SQL MDF file in Excel or Access?
Not directly. Attach it in SQL Server first, then connect Excel or Access to the database to view tables.
Can I open an MDF disc image without software?
No. Windows 10 needs a third-party tool to mount MDF images, or you can convert them to ISO.
Is it safe to delete MDF files?
Not if a program uses them. Deleting an SQL MDF deletes that database’s data.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.