I was down to my last few gigabytes on a 256GB laptop, and no amount of deleting temp files made a dent. Then I ran one command and watched 11GB of storage reappear—without losing a single personal file. That command, compact /compactos:always, activates a little-known Windows feature called CompactOS that compresses the operating system itself. It’s been hiding in plain sight since Windows 10, and on modern hardware, you probably won’t even notice it’s working.
What CompactOS Actually Does to Your Files
CompactOS isn’t your grandfather’s NTFS compression. Instead of applying a generic algorithm to any folder you choose, it targets only the core system binaries—the executables, libraries, and read-only components that Windows reads constantly but rarely writes. When enabled, those files are stored in a compressed form and decompressed on the fly as they’re loaded into memory.
The technical distinction matters. Classic NTFS compression can slow down writes because files must be compressed before storage. CompactOS, by contrast, is built for a read-heavy workload. It uses an executable-optimized compression pipeline that balances ratio and CPU cost specifically for Windows system workloads. The result: less data needs to travel from your drive to RAM, and any extra CPU cycles spent decompressing are often offset by the reduced I/O.
Microsoft originally created CompactOS for devices with tiny internal storage—budget laptops, tablets, and embedded appliances where every gigabyte counts. The company’s official documentation for the compact command confirms it as a supported, reversible operation, not a hack.
Who Stands to Benefit Most
The feature shines on storage-constrained systems. If your laptop has a 128GB or 256GB SSD and you’re constantly juggling files, reclaiming 10–15GB can be a game changer. The MakeUseOf article that first spotlighted this trick showed an 11GB gain; How-To Geek’s hands-on testing reported similar modest but real wins.
On a 1TB drive with hundreds of free gigabytes, the same gain is a rounding error. The percentage of reclaimed space—roughly 4–8% of a small drive—drops to under 1% on larger disks, making the (small) performance trade-off harder to justify.
Modern CPUs handle the decompression with ease. In many cases, especially on NVMe SSDs, the net effect on system responsiveness is neutral or even slightly positive, because fewer bytes are read from the drive. Older or underpowered processors, however, might show a slight lag when loading applications or during updates, as the extra decompression work competes with other tasks.
When to Think Twice Before Enabling CompactOS
CompactOS isn’t a universal fix. The CPU overhead, while negligible for most, can become noticeable on machines that are already struggling. A netbook with an Intel Atom processor or an old desktop running a budget Celeron may not have the headroom to comfortably decompress binaries on every access. If your system feels sluggish under basic use, adding this layer could make it worse.
Workloads that hammer system binaries also deserve caution. A compilation server, a build machine, or a heavy virtualization host that continually launches and terminates processes might see cumulative slowdowns. For these scenarios, measure before and after with a reproducible benchmark.
Finally, if you’re already sitting on plenty of free space, the feature simply isn’t worth your time. CompactOS is an edge-case lever, not a routine maintenance tweak.
How to Enable It in Two Commands
All you need is an elevated Command Prompt. Right-click Start, choose “Windows Terminal (Admin)” or search for cmd, right-click, and select “Run as administrator.” Then:
-
Check your current state:
compact /compactos:query
If it reports “The system is not in the Compact state,” you’re ready to proceed. (Some systems, especially those with small drives, may already have it enabled automatically by Windows.) -
Turn it on:
compact /compactos:always
There’s no progress bar; the command runs in the background and returns only a summary when done. On a modern SSD, expect completion within 10–30 minutes. The MakeUseOf author waited 23 minutes for 11GB; your mileage will vary based on drive speed, CPU, and how many system files need compression.
No reboot is required. Windows immediately begins serving compressed binaries from disk, and applications continue to run normally.
What If You Change Your Mind?
Reversibility is a key strength. If you notice any unexpected slowdowns or simply decide you don’t need the extra space, open the same admin terminal and run:
compact /compactos:never
This decompresses everything back to its original state. The process takes roughly the same amount of time as the initial compression. Afterward, your system footprint returns to exactly what it was before.
There is no danger of data loss—CompactOS only changes how files sit on disk, not their contents. It’s one of the safest space-saving tricks in Windows.
The Full Cleanup Toolbox: Beyond CompactOS
Before you reach for CompactOS, consider that other, often larger, space hogs may be lurking. Volume Shadow Copy, the hibernation file, and the WinSxS component store can each consume tens of gigabytes. A systematic approach yields far more free space than any single command.
- Inspect shadow storage: Run
vssadmin list shadowstoragein an admin prompt. If it shows many gigabytes reserved for System Restore points you don’t need, open Disk Cleanup as administrator, click “Clean up system files,” and select “System Restore and Shadow Copies.” This alone often reclaims 20–30GB. - Disable hibernation:
powercfg /hibernate offdeletes thehiberfil.sysfile, which is typically as large as your installed RAM. On a 16GB machine, that’s a quick 16GB back. - Clean the component store:
DISM /Online /Cleanup-Image /AnalyzeComponentStoreshows how much space is reclaimable. ThenDISM /Online /Cleanup-Image /StartComponentCleanupremoves superseded updates. Adding/ResetBasefrees even more but is irreversible—just like deleting shadow copies. - Purge Windows Update cache: Use Disk Cleanup’s “Windows Update Cleanup” option, or manually delete the contents of
C:\\Windows\\SoftwareDistribution\\Downloadafter stopping the Windows Update service. - Find big single files: Tools like WizTree or WinDirStat scan your drive and reveal hidden space eaters such as virtual disk images (VHDX), Windows Search index files, or forgotten ISO downloads. In many real-world cases, one or two giant files account for most of the missing space.
Only after these housekeeping steps should you turn to CompactOS. When you do, it’s best used as the final piece of a broader cleanup strategy, not the first.
Outlook: Why Microsoft Keeps It Quiet
CompactOS remains conspicuously absent from the Settings app. Microsoft doesn’t advertise it, and the only official interface is the command line. That’s likely by design. The feature changes the on-disk representation of system files in a way that can benefit constrained devices but requires workload-dependent testing. For the average consumer laptop, Windows often makes sensible decisions automatically—enabling compression on very small drives out of the box and leaving it off on larger ones.
For power users and IT pros, though, the compact command is a reminder that Windows still packs decades of fine-grained control under the hood. Used with care and combined with other proven cleanup methods, CompactOS can extend the useful life of storage-limited PCs without a single deletion.
Whether Microsoft ever surfaces a GUI toggle for it depends on how many users discover and rely on the feature. For now, it remains a quiet, reversible, and surprisingly effective lever for those who know where to look.