How Does Windows 10 CompactOS Compression Work?

CompactOS is an execution-level compression mechanism introduced in Windows 10 that shrinks operating system binaries to reclaim several gigabytes of internal storage. By leveraging modern file-system algorithms directly inside the NTFS file system, it decompresses system files transparently on the fly during boot and normal execution without requiring a separate recovery image.

Understanding CompactOS

CompactOS evolved from the Windows 8.1 feature known as WIMBoot (Windows Image Boot). WIMBoot allowed devices with constrained storage, such as budget tablets and netbooks with 16 GB or 32 GB eMMC drives, to run Windows from a compressed .wim file. However, WIMBoot required a separate disk partition and introduced update fragmentation when OS patches were applied.

Windows 10 replaced WIMBoot with CompactOS, removing the need for dedicated partitions. CompactOS applies file-level compression directly to the standard OS directory hierarchy (C:\Windows, C:\Program Files, and system dependencies). Because the files reside within standard directories, servicing updates and installing cumulative patches occurs directly in place without breaking the compression architecture.

Underlying Compression Mechanisms

CompactOS utilizes native NTFS compression enhancements introduced alongside Windows 10. While legacy NTFS compression relies on LZNT1 (a variant of LZ77), CompactOS uses significantly more efficient algorithms:

Files compressed via CompactOS receive the FILE_ATTRIBUTE_SPARSE_FILE or a designated reparse point indicating that the data clusters are compressed using Windows Overlay Filter (WOF). When an application or kernel process requests a file, Wof.sys intercepts the I/O read, decompresses the required blocks in memory, and passes the raw data to the caller without persistent disk writes.

Performance and Hardware Impact

Decompressing data during runtime introduces a trade-off between processor overhead and disk read times:

Checking and Managing CompactOS via Command Line

Administrators can evaluate or alter the system compression state using the built-in compact.exe utility inside an elevated Command Prompt.

To query the current state:

compact.exe /compactos:query

The system will report whether the OS is currently running in compact state and whether Windows considers the state beneficial for the machine's hardware configuration.

To force system compression:

compact.exe /compactos:always

To uncompress the operating system and revert to standard storage:

compact.exe /compactos:never

During Windows setup, the installer automatically assesses system capabilities, evaluating storage size, RAM capacity, and drive performance. If storage constraints are detected, Windows enables CompactOS automatically to ensure sufficient free space remains for user profiles, operational paging, and future updates.