How to Use Compact OS in Windows 11 to Compress System Files and Reclaim Disk Space

Windows 11 features robust capabilities and visual modernizations, but its operating system footprint—combined with cumulative update caches, WinSxS component stores, and pre-installed system binaries—can consume 25 GB to 35 GB of local storage. On portable devices with smaller solid-state drives (such as 128 GB or 256 GB tablets, lightweight laptops, or virtual machines running on constrained hypervisors), storage space comes at a premium. Windows includes a built-in kernel-level file compression technology: Compact OS.

Managed via the native compact.exe command-line utility, Compact OS compresses core operating system files into read-only containers, allowing Windows to execute directly from compressed binaries while reclaiming 4 GB to 7 GB of disk space with negligible CPU overhead.

How Does Compact OS Work?

Compact OS is the modern evolution of the Windows 8.1 WIMBoot architecture. Instead of maintaining a separate static recovery image, Compact OS applies lightweight, hardware-accelerated compression algorithms (such as XPRESS4K or LZX) directly to individual system files within C:\Windows and C:\Program Files:

  • Transparent Decompression: The Windows filesystem filter driver decompresses system files on-the-fly into RAM when required by running applications. Modern multi-core processors decompress data faster than flash storage reads uncompressed data, resulting in virtually zero perceptible performance degradation.
  • Update Resilient: Unlike temporary cleanup tools, Compact OS maintains its compression state across cumulative Windows Updates, automatically compressing newly installed OS patches.
  • Safe and Fully Reversible: Compact OS can be enabled or disabled at any time with a single command without reinstalling Windows or risking data corruption.

Core Command Syntax and Modifiers

Managing Compact OS requires an elevated Terminal (Administrator) prompt. The primary command structure uses the /compactos switch:

Command Invocation Operational Role Execution Context
compact.exe /compactos:query Queries active compression state Checks whether the system is currently compressed or uncompressed.
compact.exe /compactos:always Enforces full OS compression Compresses all eligible operating system files to reclaim maximum storage.
compact.exe /compactos:never Reverts OS compression Decompresses all system files back to standard uncompressed formats.

Querying Current Compact OS State

Before modifying storage parameters, check whether Windows has already enabled compression automatically:

compact.exe /compactos:query

The utility evaluates hardware characteristics and returns one of three states:

  • The system is not in the Compact state, but may become so as needed. (Default on most desktop PCs).
  • The system is in the Compact state. (Active; system files are currently compressed).
  • The system is not in the Compact state because Windows has determined it is not beneficial.

Enabling Compact OS to Reclaim Disk Space

To compress operating system binaries and reclaim several gigabytes of storage:

  1. Press Win + X and select Terminal (Admin).
  2. Execute the enforcement command:
    compact.exe /compactos:always
  3. Windows will begin compressing thousands of core files in the background. The terminal displays real-time progress:
    Completed [########################################] 100%
    Compressed 45,210 files in 11,420 directories.
    5,820,140,210 total bytes of data are stored in 3,110,480,100 bytes.
    The compression ratio is 1.9 to 1.
  4. Open File Explorer to confirm that free space on your C: drive has expanded by approximately 4 GB to 6 GB.

Disabling Compact OS (Decompression)

If you upgrade your physical SSD and wish to return Windows to its uncompressed state:

compact.exe /compactos:never

The tool decompresses all system binaries back to their raw, uncompressed footprints.

Frequently Asked Questions

Does Compact OS affect user personal files like photos and downloads?

No. The /compactos flag operates strictly on core Windows operating system binaries and pre-installed system assemblies. Your personal files, photos, videos, and game directories in C:\Users remain uncompressed.

Can Compact OS cause system instability or Blue Screen crashes?

No. Compact OS is an officially supported, Microsoft-engineered deployment feature utilized on millions of Windows tablets and Surface devices worldwide.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.