NTFS compression is a built-in file system feature in Windows that stores file data on an NTFS volume in compressed form and decompresses it transparently whenever an application reads it. Within Windows storage & file systems, it is the oldest native space-saving mechanism, available since Windows NT 3.51, and it works per file or per folder through a simple compression attribute.
Because the file system performs the work, applications see ordinary files of their original logical size and need no changes. The trade-off is extra CPU work and fragmentation in exchange for disk space, a balance that has shifted considerably as storage became cheaper and processors faster.
How NTFS compression stores data
NTFS compression uses the LZNT1 algorithm, a variant of LZ77 designed for fast decompression. The file system divides each file into compression units of 16 clusters, which equals 64 KB on a volume with 4 KB clusters, and compresses each unit independently.
If a unit shrinks by at least one cluster, NTFS writes the smaller version and records the saved clusters as unallocated sparse runs. If compression does not save a full cluster, the unit is stored uncompressed. This unit-based design allows random access: reading a byte in the middle of a large file requires decompressing only one 64 KB unit, not the entire file.
The following table lists the key technical parameters that determine how the feature behaves.
| Parameter | Value or behavior | Practical effect |
|---|---|---|
| Algorithm | LZNT1 (LZ77 family) | Fast, moderate compression ratio |
| Compression unit | 16 clusters, 64 KB at 4 KB clusters | Random access stays efficient |
| Supported cluster size | 4 KB or smaller | Unavailable on volumes with larger clusters |
| Granularity | Per file or per folder | Selective use is possible |
| Typical saving | Roughly 30-60% on text, near 0% on media | Depends entirely on data type |
Enabling and managing compression
Users enable compression through File Explorer by opening a file’s or folder’s Properties, choosing Advanced and selecting Compress contents to save disk space. Explorer can display compressed items with blue file names, a visual cue that the attribute is set.
Administrators usually prefer the command line. The compact utility sets, clears and reports the attribute, while fsutil behavior set disablecompression 1 prevents compression system-wide on NTFS volumes. Setting the attribute on a folder makes new files inherit compression, but existing files change only when the operation is applied to them.
| Command | Purpose |
|---|---|
compact /c /s:D:\Logs | Compress a folder tree and mark it for new files |
compact /u file.dat | Decompress a single file |
compact /q /s:D:\Logs | Report compression ratio summary |
fsutil behavior set disablecompression 1 | Disable the feature on the system |
Copy and move operations follow a clear rule. A file copied into a compressed folder becomes compressed, and a file moved within the same volume keeps its original state. A file moved to another volume behaves like a copy and takes on the target folder’s attribute.
NTFS compression compared with related technologies
NTFS compression is one of several space-saving mechanisms in modern Windows, and they differ in algorithm, scope and write behavior. The newer Windows Overlay Filter (WOF) compression, used by Compact OS and by compact /exe, achieves better ratios but suits files that rarely change.
| Mechanism | Algorithm | Best suited for | Behavior on write |
|---|---|---|---|
| NTFS compression | LZNT1 | Logs, documents, rarely read archives | Recompresses transparently |
| WOF compression | XPRESS 4K to 16K, LZX | Program and system files | File reverts to uncompressed |
| Compact OS | WOF with XPRESS | Whole Windows installation | Updates may restore files uncompressed |
| ZIP archive | Deflate | Transfer and long-term storage | Requires explicit extraction |
NTFS compression is also mutually exclusive with the Encrypting File System: a file can be compressed or encrypted with EFS, but not both. ReFS does not offer this feature in the same form, and BitLocker operates at the volume level, so it combines freely with compressed files.
Performance and where compression makes sense
The performance impact depends on the ratio between CPU speed and disk speed. On slow hard drives, reading fewer physical clusters could offset the decompression cost, and compressed text files sometimes opened faster than uncompressed ones. On fast NVMe SSDs, the storage is rarely the bottleneck, so compression adds CPU overhead without speed benefit.
Write-heavy files suffer most. Every modification forces NTFS to recompress the affected unit, and a unit that grows may need new clusters elsewhere, which causes heavy fragmentation over time.
| Workload | Recommendation | Reason |
|---|---|---|
| Text logs and old documents | Good candidate | High ratio, infrequent rewrites |
| JPEG, MP4, ZIP files | Avoid | Already compressed, no saving |
| Database and VHDX files | Avoid | Random writes cause fragmentation and latency |
| Small SSD with archive data | Reasonable | Recovers space with little cost |
Limitations and common mistakes
The most frequent mistake is compressing an entire system drive to recover space. This slows updates and application launches and gives limited gain, because executables and media compress poorly with LZNT1. Compact OS is the supported option for shrinking a Windows installation.
- Free-space reports can mislead: Explorer shows both size and size on disk, and only the latter reflects the saving.
- Copying to another drive or the network transfers the full uncompressed data.
- Large cluster sizes, such as 64 KB volumes formatted for databases, disable the option entirely.
- Backup software may read and transmit uncompressed data, so backup volumes do not shrink accordingly.
In plain words
NTFS compression lets Windows squeeze files so they take less room on the disk. You still see and open the files normally, and Windows quietly unpacks them each time a program needs them.
It is a bit like vacuum-packing clothes in a suitcase. You save space, but packing and unpacking takes a little effort every time. The key takeaway: it helps with files that contain mostly text and rarely change, and it does little for photos, videos or files that change constantly.
A real-world example
A systems administrator at a small manufacturing company runs a Windows Server that collects machine logs in plain text on a 500 GB data volume. The logs grow by about 4 GB per week and must be kept for two years, and the volume is approaching 90% utilization.
The administrator runs compact /c /s:D:\MachineLogs overnight to apply NTFS compression to the log folder. Because the logs are repetitive text, the folder shrinks from 310 GB to roughly 120 GB of space on disk, and new log files are compressed automatically as they are written. CPU usage on the server rises only slightly during writes, and the purchase of additional storage is postponed by more than a year.