Compact OS is a Windows storage feature that compresses the operating system files of an installation so that Windows occupies noticeably less disk space while remaining fully functional. Introduced with Windows 10, it applies transparent per-file compression to system binaries and preinstalled apps, and it is managed with the compact.exe command, where it is also written as CompactOS.
Within Windows storage & file systems, Compact OS sits between ordinary NTFS compression and older image-based approaches. It typically recovers about 1.5 to 3 GB on a standard installation, which matters most on devices with 32 GB or 64 GB of eMMC storage, while costing a small amount of processor time whenever compressed files are read.
How Compact OS compresses Windows files
Compact OS relies on the Windows Overlay Filter (WOF), a file system filter driver that sits above NTFS. Each compressed file keeps its normal name and path, but its data is stored in an alternate data stream in compressed form, while the primary stream is marked as a reparse point that tells WOF to decompress the content on read.
The compression is read-optimized: files are compressed once, then decompressed in memory each time they are opened. When a compressed file is modified, for example by an update, it is written back uncompressed and must be recompressed later. This design suits system files, which are read constantly but changed rarely, and explains why Compact OS is not a general data compression tool.
WOF supports several compression algorithms, which differ in ratio and speed. The table shows the options that compact.exe exposes for this kind of compression.
| Algorithm | Chunk size | Relative ratio | Decompression cost |
|---|---|---|---|
| XPRESS4K | 4 KB | Lowest | Very low |
| XPRESS8K | 8 KB | Moderate | Low |
| XPRESS16K | 16 KB | Higher | Moderate |
| LZX | 32 KB | Highest | Highest |
When Compact OS is enabled for the whole system, Windows chooses the algorithm automatically, commonly an XPRESS variant that balances space and speed. LZX produces the best ratio but adds the most CPU work, so it is usually applied only to selected folders of rarely changed files.
Managing Compact OS with compact.exe
Compact OS is controlled from an elevated Command Prompt or PowerShell session with the /CompactOS switch of compact.exe. The three commands below cover querying, enabling and disabling the feature for the running installation.
| Command | Action | Typical duration |
|---|---|---|
| compact /CompactOS:query | Reports whether the system is compressed | Seconds |
| compact /CompactOS:always | Compresses all eligible system files | 10 to 30 minutes |
| compact /CompactOS:never | Decompresses system files | 10 to 30 minutes |
The query option also reports whether Windows considers the device suitable for compression. Windows can enable Compact OS automatically during setup or after an upgrade on devices with little storage, and the setting persists across feature updates because setup reapplies it to the new system files.
Administrators preparing images can apply the same compression offline. With DISM, the /Compact option of /Apply-Image writes the files in compressed form directly, which avoids compressing them later on each device and is the usual approach in OEM and enterprise deployment.
Compact OS compared with other Windows space-saving methods
Compact OS is one of several Windows techniques that reduce disk usage, and each targets a different kind of data. Knowing which is which prevents duplicated effort and unrealistic expectations.
| Method | What it affects | Main trade-off |
|---|---|---|
| Compact OS | System files and preinstalled apps | Small CPU cost on reads |
| NTFS compression | Any user-selected files or folders | Slower writes, fragmentation |
| WIMBoot | Files served from a compressed image | Retired; problems with updates |
| Storage Sense | Temporary files and cloud placeholders | Deletes or dehydrates content |
| Disk Cleanup | Caches, logs and old update files | Manual and one-time |
The closest relative is NTFS compression, which uses the LZNT1 algorithm and supports writing data in compressed form. Compact OS uses the newer WOF path instead, which achieves better ratios with faster reads but does not keep files compressed after they are rewritten. Compact OS also succeeded WIMBoot, from Windows 8.1, which booted from a compressed image file and caused growing disk use as updates replaced files.
When Compact OS makes sense
Compact OS is most useful when free space, not processor capacity, is the limiting resource. On modern hardware the decompression cost is usually imperceptible, but the benefit is small on large drives. The decision table summarizes typical situations.
| Situation | Recommendation | Reason |
|---|---|---|
| 32 GB or 64 GB tablet or laptop | Enable | Recovered gigabytes leave room for updates |
| Feature update fails for lack of space | Enable temporarily | Frees space needed by setup |
| Modern PC with a 512 GB SSD | Usually leave off | Savings are negligible |
| Low-power CPU with slow storage | Test first | Reads may be faster or slower |
| Virtual machines in large numbers | Consider enabling | Saves space across many disks |
On devices with slow eMMC or hard disk storage, compression can even speed up some operations, because reading fewer bytes from a slow medium outweighs the decompression work. On fast NVMe drives the effect tends to reverse slightly, although the difference is rarely noticeable in everyday use.
Limitations and common misconceptions
Compact OS has clear boundaries, and several widespread assumptions about it are wrong. The most important points for administrators are these.
- It does not compress user data: documents, photos and most installed third-party programs remain untouched.
- Updated files lose compression until Windows or an administrator compresses them again.
- It is not encryption and offers no protection for confidentiality; that role belongs to BitLocker or the Encrypting File System.
- Savings vary by edition and build, so published figures should be treated as estimates rather than guarantees.
- Decompressing requires free space: running
/CompactOS:neveron a nearly full drive can fail midway.
Some backup and imaging tools that do not understand WOF reparse points may copy files incorrectly or restore them uncompressed, which can unexpectedly fill a small target disk. Verifying tool support before relying on such software is a sensible precaution.
Stripped to the essentials
Windows itself takes up many gigabytes of storage. Compact OS squeezes the Windows files into a smaller package, much like vacuum-packing clothes so they fit into a smaller suitcase.
Whenever Windows needs one of those files, it unpacks it instantly in memory. The computer does a little extra work, but on small devices that trade is worth it because the saved space leaves room for updates and personal files.
Where it is applied
A school IT administrator manages a fleet of low-cost laptops with 64 GB of eMMC storage. Several machines fail a Windows feature update because only 6 GB remain free after student files and apps are installed.
The administrator runs compact /CompactOS:query on a sample device, confirms that compression is off, and then runs compact /CompactOS:always from an elevated prompt. After about twenty minutes the system folder shrinks by roughly 2.5 GB, and the next update installs successfully. The administrator then adds the command to the deployment script, so new laptops are compressed before reaching students, and no performance complaints follow.