.NDF

NDF File

Microsoft SQL Server Secondary Data File
Ask a question
QUICK ANSWER

An NDF file is a secondary data file for a Microsoft SQL Server database. It stores part of the database alongside the primary .mdf file. NDF files cannot be opened on their own - they must be attached to SQL Server together with the matching MDF and LDF files using SQL Server Management Studio or a T-SQL command.

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

On this page

19k+ extensions indexed
Last reviewed Aug 14, 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 NDF file format?

.ndf is a secondary data file used by Microsoft SQL Server to store relational database content. It extends a database beyond its primary .mdf file, typically to spread data across multiple physical disks for improved I/O throughput or to exceed single-file size limits. A database may have zero or many .ndf files; they are always optional.

Internally, .ndf files use the identical 8 KB page-based binary format as .mdf primary files. Each page is numbered and classified by type: data pages hold table rows, index pages hold B-tree index structures, and allocation pages (PFS, GAM, SGAM) track free space. Pages are grouped into 64 KB extents of 8 contiguous pages. Optional page-level compression (row or page compression, SQL Server 2008+) and Transparent Data Encryption (TDE, AES-128/256) apply to .ndf files identically to .mdf.

An .ndf file cannot be opened or recovered in isolation - SQL Server must attach it together with the primary .mdf and the transaction log .ldf as a complete database unit. The maximum file size is 16 TB on SQL Server 2016 and later.

The format was formalised with SQL Server 7.0 (1998), and the internal page format has remained essentially unchanged since then. SQL Server 2017 extended support to Linux and container environments using the same file format.

Security & safety

RISK: LOW

SQL Server data files are passive binary data stores. The risk is data confidentiality - NDF files may contain sensitive database content. If found unexpectedly on a system, verify the source database before sharing. TDE-encrypted NDF files require the encryption key to access.

Format details

in a nutshell
FULL NAMEMicrosoft SQL Server Secondary Data Fileaka SQL Server NDF file, secondary database file
DEVELOPERMicrosoft Corporationsince SQL Server 7.0 (1998) - NDF extension formalised; data page format consistent since SQL Server 7
MIME TYPEapplication/octet-stream
TYPEbinary relational database data file (secondary)
This extension is also used by…
  • Navision Database File (older Microsoft Dynamics NAV) - .ndf was used as the native database file extension in older Microsoft Navision/Dynamics NAV installations before migration to SQL Server.
MAGIC BYTES · FILE SIGNATURE
OFFSET
00010203
HEX
010F0000
ASCII
····
SQL Server data files (MDF and NDF) share the same internal format. The first page (page 0) is the file header page. Bytes 0-3 typically begin 01 0F 00 00 (page type 0x01 = data page, though exact header bytes may vary by SQL Server version). No distinct NDF vs MDF magic bytes - both are identified by the SQL Server engine from the database catalog, not by a standalone file signature. Confidence on exact hex is medium; treat as approximate.

Programs that open NDF files

Windows3 apps
Microsoft SQL Server (any edition) Freemium In SSMS: right-click Databases > Attach > Add MDF file (SQL Server auto-locates NDF). Via T-SQL: CREATE DATABASE mydb ON (FILENAME='path\file.mdf'), (FILENAME='path\file.ndf') LOG ON (FILENAME='path\file.ldf') FOR ATTACH;
SQL Server Management Studio (SSMS) Free GUI front-end for the attach operation above. Connect to SQL Server instance, Databases > Attach.
SysTools SQL Recovery Paid Recovery tool for corrupted/detached NDF/MDF files when SQL Server cannot attach them normally.
Linux1 app
Microsoft SQL Server for Linux Freemium SQL Server 2017+ runs natively on Linux/Docker; same T-SQL ATTACH command as Windows.

Technical details

deep spec
DeveloperMicrosoft Corporation
EncodingBinary (little-endian)
Page size8 KB (8,192 bytes) per page - identical internal format to MDF primary files
Extent size64 KB (8 contiguous 8 KB pages)
Page typesData, index, LOB/text, PFS, GAM, SGAM, IAM, and file header pages
CompressionOptional - row or page compression (SQL Server 2008+, Enterprise and Developer editions)
EncryptionOptional - Transparent Data Encryption (TDE), AES-128 or AES-256 (SQL Server 2008+)
Page integrityPAGE_VERIFY CHECKSUM by default since SQL Server 2005; stored in 96-byte page header
Maximum file size16 TB (SQL Server 2016+)
Default autogrowth increment64 MB per event (SQL Server 2012+)
PlatformWindows; Linux (SQL Server 2017+); Docker and container environments
DependencyCannot be opened alone - must be attached with .mdf primary file and .ldf log file
IntroducedSQL Server 7.0 (1998) - secondary data file convention formalised at this version
ReleasedSQL Server 7.0 (1998) - NDF extension formalised; data page format consistent since SQL Server 7
Latest versionSQL Server 2022 (v16); page format essentially unchanged since SQL Server 7
Specificationlearn.microsoft.com

NDF conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with NDF 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 NDF files.

Frequently asked questions

Can I open an NDF file directly without SQL Server?
Not in any meaningful way. NDF files require SQL Server to attach and query them. Third-party recovery tools (SysTools, Stellar) can extract data from corrupted files without a running instance.
I only have an NDF file but not the MDF. Can I recover data?
Extremely difficult. The database boot page (page 9) is in the MDF; without it, SQL Server will not attach. Some recovery tools can attempt partial extraction from an NDF alone.
What is the difference between MDF and NDF?
MDF is the primary data file (required, contains the boot page and default filegroup). NDF is optional secondary data file(s) for additional filegroups or disk distribution. They share the same internal page format.
How do I attach an NDF file to SQL Server?
You must attach the entire file set: SSMS > Databases > Attach > Add the MDF file. SQL Server will ask for the NDF and LDF paths if they differ from recorded locations.
Can SQL Server run on Linux with NDF files?
Yes - SQL Server 2017+ runs on Linux and Docker and uses the same NDF/MDF/LDF format as on Windows.

References

1Microsoft Learn - Database Files and Filegroupslearn.microsoft.com
2Microsoft Learn - Pages and Extents Architecture Guidelearn.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.MDMarkdown Document
3.CRDOWNLOADChrome Partial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data 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