Low storage space on a Windows 11 device can cause slow performance, failed updates, and error messages about insufficient disk space. Compact OS is a built-in feature that reduces the size of the Windows operating system by compressing system files, freeing up several gigabytes of space. This article explains how to safely enable or disable Compact OS using the command line, what happens to your system when you toggle it, and which storage amounts make it a worthwhile trade-off.
Key Takeaways: Toggle Compact OS on Windows 11
- Command Prompt as Administrator > compact /compactos:query: Checks whether Compact OS is currently enabled or disabled on your device.
- Command Prompt as Administrator > compact /compactos:always: Forces Compact OS to compress system files and free up disk space.
- Command Prompt as Administrator > compact /compactos:never: Disables Compact OS and decompresses system files back to their original size.
What Is Compact OS and How Does It Save Space on Windows 11
Compact OS is a Windows feature introduced in Windows 10 and carried over to Windows 11. It compresses the operating system files, including the Windows folder, Program Files, and system binaries. The compression algorithm used is the same as the one in the Windows Imaging Format, known as WIMBoot. When enabled, individual files are compressed on the fly, and the system decompresses them as needed during read operations.
The space savings vary depending on the size of your Windows installation. On a typical Windows 11 system, Compact OS can recover 1.5 GB to 6 GB of disk space. Devices with 64 GB or 128 GB storage drives benefit the most. The feature works on both HDDs and SSDs, but the performance impact differs. On an SSD, the compression and decompression overhead is minimal because of the drive’s fast random read speeds. On a slower HDD, the CPU must work harder to decompress files, which can reduce overall system responsiveness.
Compact OS is not the same as disk compression via File Explorer’s folder properties. File Explorer compression uses a different algorithm and compresses only selected folders. Compact OS compresses the entire operating system at the file level, which is more efficient and transparent to applications. No user interaction is required after toggling it; the change takes effect after a reboot.
Prerequisites Before Toggling Compact OS
Before you enable or disable Compact OS, verify the following:
- You are signed in with an account that has administrator privileges. A standard user account cannot run the compact command.
- Your device has at least 10 percent free disk space before disabling Compact OS. Disabling the feature decompresses all system files, which requires enough free space to hold the expanded files.
- You have a recent backup of your data. While toggling Compact OS is safe, any system-level operation carries a small risk of corruption. A backup protects your files if something goes wrong.
- Your Windows 11 installation is up to date. Run Windows Update and install all pending updates before proceeding.
Steps to Check and Toggle Compact OS on Windows 11
All Compact OS operations are performed using the compact command in an elevated Command Prompt window. There is no graphical user interface for this feature in Settings. Follow the steps below in order.
Step 1: Open Command Prompt as Administrator
- Open the Start menu
Press the Windows key on your keyboard or click the Start button on the taskbar. - Search for Command Prompt
Type cmd in the search box. Right-click Command Prompt in the search results and select Run as administrator. Click Yes in the User Account Control prompt that appears.
Step 2: Check the Current Compact OS Status
- Run the query command
In the Command Prompt window, type the following command and press Enter:compact /compactos:query - Read the output
The system displays one of three messages:
– “The system is in the Compact state” — Compact OS is currently enabled.
– “The system is not in the Compact state” — Compact OS is disabled.
– “Windows is determining if Compact mode is appropriate” — The system is analyzing your drive. Wait a few seconds and run the command again.
Step 3: Enable Compact OS to Free Up Disk Space
If your device is low on storage and you want to enable Compact OS, run the following command:
- Run the enable command
Type the following command and press Enter:compact /compactos:always - Wait for the process to complete
The system compresses all applicable system files. This can take 10 to 30 minutes depending on your drive speed and CPU. Do not close the Command Prompt window or shut down the computer during this process. - Restart your computer
After the command finishes, restart your device. The compressed state takes effect after the reboot.
Step 4: Disable Compact OS to Restore Original File Sizes
If you no longer need the space savings, or if performance degrades after enabling Compact OS, you can disable it. Ensure you have at least 10 percent free disk space before proceeding.
- Run the disable command
Type the following command and press Enter:compact /compactos:never - Wait for decompression to finish
The system decompresses all system files back to their original size. This takes as long as the compression process did, typically 10 to 30 minutes. - Restart your computer
Restart your device to apply the change.
Common Mistakes and Things to Avoid When Using Compact OS
Running the Command Without Administrator Privileges
If you run the compact command without administrator rights, you receive an “Access denied” error. Always right-click Command Prompt and select Run as administrator. Using PowerShell as administrator works as well, but the command syntax is identical.
Disabling Compact OS Without Enough Free Space
Disabling Compact OS requires enough free disk space to hold the decompressed system files. If your drive is nearly full, the command may fail with an error message about insufficient space. Before running compact /compactos:never, free up space by deleting temporary files, emptying the Recycle Bin, or uninstalling unused applications. Use Storage Sense in Settings > System > Storage to automate this cleanup.
Expecting Space Savings on a Drive Smaller Than 32 GB
On very small drives, such as 16 GB or 32 GB eMMC storage found on budget devices, Compact OS may not provide significant savings. The Windows installation itself occupies most of the drive, and the compression ratio is limited because many system files are already compressed. Check the actual savings by comparing the free space before and after enabling Compact OS using File Explorer.
Ignoring Performance on a Mechanical Hard Drive
On a traditional HDD, enabling Compact OS can cause noticeable slowdowns during boot and when launching large applications. The CPU must decompress files on every read, and the HDD’s slower random read speed amplifies the delay. If your device uses an HDD, test performance for a few days after enabling Compact OS. If the system feels sluggish, disable Compact OS.
Compact OS Enabled vs Disabled: Storage and Performance Trade-offs
| Item | Compact OS Enabled | Compact OS Disabled |
|---|---|---|
| Disk space used by Windows | Reduced by 1.5 GB to 6 GB | Full original size |
| CPU usage during file access | Higher due to decompression | Normal |
| Boot time on SSD | Negligible increase | Normal |
| Boot time on HDD | Noticeable slowdown | Normal |
| Application launch speed | Slightly slower on HDD | Normal |
| Recommended for | Devices with 64 GB or 128 GB SSDs | Devices with HDDs or ample storage |
You can now check your Compact OS status and toggle it based on your storage needs and drive type. If you decide to enable it, monitor free space using Storage Sense in Settings > System > Storage. For advanced users, the command compact /s followed by a folder path compresses individual folders without affecting the entire operating system, giving you finer control over space savings.