NTFS is Microsoft’s journaling file system for Windows NT and everything since. It is the default for Windows system and data volumes, from NT 3.1 through Windows 11 and Windows Server, and it is common on external drives and in virtual disks of Windows guests. The on-disk format has stayed at version 3.1 since 2001; Linux, macOS and BSD can read it, and deleted-file records often survive in the MFT, which makes it central to recovery work.
Overview
NTFS is a journaling, extent-based file system. Everything on a volume, including its own metadata, is a file. The central structure is the Master File Table ($MFT), an array of fixed-size file records. Each record holds typed attributes (name, timestamps, security, data, index entries). Small attributes are stored inside the record (resident); large ones live in clusters and are described by a list of data runs (non-resident). A file’s content is its unnamed $DATA attribute; named $DATA attributes are alternate data streams.
Directories are B-tree indexes of $FILE_NAME entries. Metadata changes are journaled in $LogFile. File names are UTF-16LE, timestamps are FILETIME (100 ns ticks since 1601-01-01 UTC), and all integers are little-endian. Optional features include LZNT1 compression, sparse files, EFS encryption, reparse points (symbolic links, junctions, mount points), hard links, quotas and the USN change journal.
History
Developed at Microsoft in the early 1990s for Windows NT (designers included Tom Miller, Gary Kimura, Brian Andrew and David Goebel); HPFS influenced its design.
1993: Windows NT 3.1 ships the first version. NT 3.5, 3.51 and 4.0 followed with small revisions.
2000: Windows 2000 introduces NTFS 3.0: quotas, EFS, sparse files, reparse points, the change journal, object IDs and $Extend.
2001: Windows XP introduces NTFS 3.1 (still the current version); the file record header gained a record number field.
2006-2007: Vista and Server 2008 add symbolic links, transactional NTFS (later deprecated) and self-healing.
2021: the Paragon-developed ntfs3 driver is merged in Linux 5.15.
Key structures
Boot sector ($Boot, sector 0)
The first sector of the volume holds the BIOS parameter block and the start of the boot code. A backup copy is stored in the last sector of the volume. Total size 512 bytes.
Offset
Size
Field
Description
0x00
3
Jump instruction
Typically EB 52 90
0x03
8
OEM ID
ASCII “NTFS ” (four trailing spaces)
0x0B
2
Bytes per sector
Usually 512 or 4096
0x0D
1
Sectors per cluster
Power of two. Values above 0x80 are interpreted as 2(256-n) sectors for very large clusters
0x0E
2
Reserved sectors
Must be 0
0x10
3
Unused
0 (FAT field)
0x13
2
Unused
0 (FAT small total sectors)
0x15
1
Media descriptor
0xF8 for fixed disks
0x16
2
Unused
0
0x18
2
Sectors per track
BIOS geometry, typically 63
0x1A
2
Number of heads
BIOS geometry, typically 255
0x1C
4
Hidden sectors
Sectors before the partition
0x20
4
Unused
0 (FAT large total sectors)
0x24
4
Unused
Typically 80 00 80 00
0x28
8
Total sectors
Sectors in the volume, not counting the backup boot sector
0x30
8
$MFT start cluster
LCN of the first cluster of $MFT
0x38
8
$MFTMirr start cluster
LCN of the first cluster of $MFTMirr
0x40
1
Clusters per file record
Signed. Positive: number of clusters. Negative: record size is 2|n| bytes (for example 0xF6 = -10 = 1024 bytes)
0x41
3
Unused
0
0x44
1
Clusters per index record
Same signed encoding as above
0x45
3
Unused
0
0x48
8
Volume serial number
64-bit random value
0x50
4
Checksum
Usually 0 and not verified
0x54
426
Boot code
Bootstrap loader
0x1FE
2
End-of-sector marker
55 AA
MFT file record header
Each $MFT entry begins with this header. The update sequence array normally follows at offset 0x30 (NTFS 3.1) and attributes follow after it.
Offset
Size
Field
Description
0x00
4
Signature
ASCII “FILE”; “BAAD” marks a record that failed a consistency check
0x04
2
Update sequence array offset
Typically 0x30
0x06
2
Update sequence array size
Number of 16-bit entries, including the USN itself (3 for a 1024-byte record)
0x08
8
$LogFile sequence number
LSN of the last journaled change
0x10
2
Sequence number
Incremented each time the record is freed and reused
0x12
2
Hard link count
Number of directory entries referring to this file
0x14
2
First attribute offset
Offset of the first attribute header
0x16
2
Flags
0x0001 in use, 0x0002 directory
0x18
4
Used size
Bytes of the record actually in use (including header)
0x1C
4
Allocated size
Size of the record on disk (for example 1024)
0x20
8
Base record reference
0 for a base record; otherwise a file reference to the base record that owns this extension record
0x28
2
Next attribute ID
ID to assign to the next attribute added
0x2A
2
Padding
NTFS 3.1+
0x2C
4
MFT record number
NTFS 3.1+: index of this record in $MFT
Attribute headers
Every attribute starts with a common header. The list ends with a four-byte end marker 0xFFFFFFFF in the type field. Attributes appear in ascending type order.
Common header (all attributes)
Offset
Size
Field
Description
0x00
4
Type
Attribute type code (see constants)
0x04
4
Length
Total attribute length including header; 8-byte aligned
1 if the value is referenced by an index (for example $FILE_NAME)
0x17
1
Padding
Non-resident attribute continuation
Offset
Size
Field
Description
0x10
8
Starting VCN
First VCN described by this attribute record
0x18
8
Last VCN
Last VCN described by this attribute record
0x20
2
Data runs offset
From the start of the attribute header
0x22
2
Compression unit size
log2 of clusters per compression unit (0 if not compressed; 4 means 16 clusters)
0x24
4
Padding
0x28
8
Allocated size
Bytes allocated to the data, a multiple of the cluster size
0x30
8
Real size
Actual data size in bytes
0x38
8
Initialized size
Bytes initialized; reads beyond this return zeros
0x40
8
Compressed size
Present only for compressed or sparse attributes
$STANDARD_INFORMATION (0x10)
Always resident. 48 bytes on NTFS 1.x, 72 bytes on NTFS 3.x.
Offset
Size
Field
Description
0x00
8
Creation time
FILETIME
0x08
8
Last modification time
FILETIME (data modified)
0x10
8
MFT change time
FILETIME (metadata modified)
0x18
8
Last access time
FILETIME
0x20
4
File attribute flags
See file attribute flags in constants
0x24
4
Maximum versions
0 if versioning is not used
0x28
4
Version number
0x2C
4
Class ID
0x30
4
Owner ID
NTFS 3.0+, used with quotas
0x34
4
Security ID
NTFS 3.0+, key into $Secure
0x38
8
Quota charged
NTFS 3.0+
0x40
8
Update sequence number (USN)
NTFS 3.0+, last USN journal record for this file
$FILE_NAME (0x30)
Always resident and indexed. A file has one for each name (a DOS 8.3 name has its own entry). The same structure is the key of directory index entries.
Offset
Size
Field
Description
0x00
8
Parent directory reference
File reference (48-bit record number plus 16-bit sequence)
0x08
8
Creation time
FILETIME
0x10
8
Last modification time
FILETIME
0x18
8
MFT change time
FILETIME
0x20
8
Last access time
FILETIME
0x28
8
Allocated size
Often 0 and not kept up to date
0x30
8
Real size
Often 0 and not kept up to date
0x38
4
Flags
File attribute flags; also 0x10000000 directory, 0x20000000 index view
0x3C
4
Reparse tag / EA size
Reparse tag if the reparse flag is set; otherwise extended attribute size
0x40
1
Name length
In UTF-16 code units
0x41
1
Namespace
0 POSIX, 1 Win32, 2 DOS, 3 Win32 and DOS
0x42
2 x n
Name
UTF-16LE, not NUL-terminated
$ATTRIBUTE_LIST (0x20) entry
Present when a file’s attributes do not fit in one record. It lists the attributes and the record that holds each one. Entries are packed one after another.
Offset
Size
Field
Description
0x00
4
Attribute type
0x04
2
Entry length
Includes the name; 8-byte aligned
0x06
1
Name length
UTF-16 code units
0x07
1
Name offset
Normally 0x1A
0x08
8
Starting VCN
First VCN of the attribute chunk in the referenced record
0x10
8
File reference
MFT record that holds the attribute
0x18
2
Attribute ID
0x1A
2 x n
Name
UTF-16LE, if named
$OBJECT_ID (0x40)
Resident. Only the first field is always present; the others may be absent (length 16, 32, 48 or 64).
Offset
Size
Field
Description
0x00
16
Object ID
GUID unique on the volume
0x10
16
Birth volume ID
GUID of the volume on which the file was created
0x20
16
Birth object ID
Original object ID
0x30
16
Domain ID
Reserved
$VOLUME_INFORMATION (0x70)
Resident, 12 bytes, found only in the $Volume file (record 3).
Offset
Size
Field
Description
0x00
8
Reserved
0
0x08
1
Major version
3 on NTFS 3.x
0x09
1
Minor version
0 or 1
0x0A
2
Volume flags
0x0001 dirty (checked at next mount), 0x0002 resize $LogFile, 0x0004 upgrade on mount, 0x0008 mounted on NT 4, 0x0010 deleting USN journal, 0x0020 repair object IDs, 0x8000 modified by chkdsk
Data runs (non-resident attributes)
A run list is a packed sequence of variable-length entries stored at the data-runs offset of a non-resident attribute. It ends with a single 0x00 byte.
Offset
Size
Field
Description
0x00
1
Header byte
Low nibble L = bytes in the length field; high nibble O = bytes in the offset field
0x01
L
Run length
Unsigned, in clusters
0x01+L
O
Run offset
Signed, relative to the previous run’s starting LCN (absolute for the first run). O = 0 means a sparse run with no allocated clusters
Example: 21 18 34 56 00 is one run of 0x18 clusters starting at LCN 0x5634. The header 21 means a 1-byte length (18) and a 2-byte offset (34 56 = 0x5634 little-endian), and 00 ends the list.
Indexes: $INDEX_ROOT, $INDEX_ALLOCATION and INDX records
Directories are B-trees. The root node lives in a resident $INDEX_ROOT (named $I30 for directories); overflow nodes live in INDX records inside the non-resident $INDEX_ALLOCATION, tracked by a $BITMAP.
$INDEX_ROOT (0x90) value header
Offset
Size
Field
Description
0x00
4
Indexed attribute type
0x30 for file-name indexes; 0 for non-attribute indexes
0x04
4
Collation rule
See constants
0x08
4
Bytes per index record
Typically 4096
0x0C
1
Clusters per index record
Same encoding as in the boot sector
0x0D
3
Padding
0x10
16
Index node header
See below
Index node header (16 bytes)
Offset
Size
Field
Description
0x00
4
First entry offset
Relative to the start of this node header
0x04
4
Total size of entries
Used bytes, including this header
0x08
4
Allocated size
0x0C
1
Flags
0x01 large index (entries exist in $INDEX_ALLOCATION)
0x0D
3
Padding
INDX record header (precedes an index node header in $INDEX_ALLOCATION)
Offset
Size
Field
Description
0x00
4
Signature
ASCII “INDX”
0x04
2
Update sequence array offset
Typically 0x28
0x06
2
Update sequence array size
Entries including the USN (9 for a 4096-byte record)
0x08
8
$LogFile sequence number
0x10
8
This record’s VCN
VCN within $INDEX_ALLOCATION
0x18
16
Index node header
As above; entry offsets are relative to 0x18
Index entry (directory entries use a $FILE_NAME structure as the key)
Offset
Size
Field
Description
0x00
8
File reference
MFT reference of the file this entry names
0x08
2
Entry length
Total, 8-byte aligned
0x0A
2
Key length
Size of the key that follows
0x0C
2
Flags
0x01 entry has a sub-node, 0x02 last entry in the node (carries no key)
0x0E
2
Padding
0x10
n
Key
For directories a $FILE_NAME attribute value
end-8
8
Sub-node VCN
Present only if the sub-node flag is set; VCN of the child INDX record
$REPARSE_POINT (0xC0)
Marks a file or directory whose handling is delegated to a file system filter. The tag identifies the owner (symbolic link, junction, WOF and so on).
Offset
Size
Field
Description
0x00
4
Reparse tag
See reparse tags in constants
0x04
2
Reparse data length
Bytes of tag-specific data
0x06
2
Reserved
0x08
n
Reparse data
Tag-specific; for non-Microsoft tags a 16-byte GUID precedes the data
USN journal record (USN_RECORD_V2)
Records stored in the $J stream of $Extend\$UsnJrnl, used by search indexers, backup and sync software to find changed files. Records are 8-byte aligned.
Offset
Size
Field
Description
0x00
4
Record length
Total, including the name
0x04
2
Major version
2
0x06
2
Minor version
0
0x08
8
File reference
File this change concerns
0x10
8
Parent file reference
0x18
8
USN
Offset of this record in the journal stream
0x20
8
Timestamp
FILETIME
0x28
4
Reason flags
Bit mask of changes (data overwrite, create, delete, rename and so on)
0x2C
4
Source info
0x30
4
Security ID
0x34
4
File attributes
File attribute flags
0x38
2
File name length
In bytes
0x3A
2
File name offset
Normally 0x3C
0x3C
n
File name
UTF-16LE
Structures
Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.
Case-sensitive, nearly all Unicode characters allowed
1
Win32
Case-insensitive, long name
2
DOS
8.3 short name
3
Win32 and DOS
Long name that is also a valid 8.3 name; one entry serves both
Index collation rules
Value
Rule
Used by
0x00000000
Binary
Generic
0x00000001
File name (case-insensitive Unicode)
Directories ($I30)
0x00000002
Unicode string
Generic
0x00000010
Unsigned 32-bit integer
$Quota $Q
0x00000011
SID
$Quota $O
0x00000012
Security hash, then ID
$Secure $SDH
0x00000013
Sequence of unsigned 32-bit integers
$ObjId $O, $Reparse $R
Common reparse tags
Value
Name
Meaning
0xA0000003
IO_REPARSE_TAG_MOUNT_POINT
Junction or volume mount point
0xA000000C
IO_REPARSE_TAG_SYMLINK
Symbolic link
0x80000013
IO_REPARSE_TAG_DEDUP
Data Deduplication
0x80000017
IO_REPARSE_TAG_WOF
Windows Overlay Filter (compact OS, WIM boot)
0x8000001B
IO_REPARSE_TAG_APPEXECLINK
Microsoft Store app execution alias
Other constants
Item
Value
Boot sector OEM ID
“NTFS “
Boot sector signature
0x55 0xAA at offset 0x1FE
MFT record signature
“FILE” (46 49 4C 45); damaged: “BAAD”
Index record signature
“INDX” (49 4E 44 58)
Directory index name
$I30
Fixup stride
512 bytes (the last 2 bytes of each stride hold the USN on disk)
Compression algorithm
LZNT1, compression unit 16 clusters (default)
FILETIME epoch
1601-01-01 00:00:00 UTC, units of 100 ns
File reference layout
bits 0-47 record number, bits 48-63 sequence number
Attribute alignment
8 bytes
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.