Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Enable or Disable NTFS File Compression in Windows

· 7 min read · Home Tech

In this article
  1. What Is NTFS Compression?
  2. How to Enable NTFS Compression
  3. How to Disable NTFS Compression
  4. How NTFS Compression Works
  5. When to Use NTFS Compression
  6. Pros and Cons of NTFS Compression
  7. Common Problems and Misconceptions
  8. Alternatives to NTFS Compression
  9. Frequently Asked Questions

NTFS file compression is a built-in Windows feature that can save disk space by compressing files and folders on NTFS-formatted drives. You can enable it per file, folder, or drive, and disable it the same way. This article explains how to turn NTFS compression on or off, how it works, its benefits and drawbacks, and answers common questions.

What Is NTFS Compression?

NTFS compression is a feature of the NTFS file system (the default for most Windows system drives) that transparently compresses files and folders. When you enable compression on a folder or drive, Windows compresses files as they are written to disk and decompresses them on read, so you don't have to do anything manually. The compression is lossless, meaning no data is lost, and the file appears and behaves normally in File Explorer.

It is important to distinguish NTFS compression from other forms of compression like ZIP files or compressed folders. NTFS compression is built into the file system, so it works for any file type, but it is not the same as a compressed archive. It also does not compress files that are already compressed (like JPEG, PNG, MP3, or video files) because they would not shrink further.

How to Enable NTFS Compression

You can enable NTFS compression in two main ways: through File Explorer’s folder properties, or using the command line (compact.exe). The File Explorer method is the most common for everyday users.

Enable compression on a folder or drive using File Explorer

  1. Open File Explorer and navigate to the folder or drive you want to compress.
  2. Right-click the folder or drive and select Properties.
  3. On the General tab, click the Advanced button.
  4. Under “Compress or Encrypt attributes,” check the box for Compress contents to save disk space.
  5. Click OK, then Apply. If you’re compressing a folder, Windows will ask whether to apply the change to just the folder or to subfolders and files. Choose the option that fits your need.

If you want to compress an entire drive, you can also right-click the drive in File Explorer, select Properties, check the box for “Compress this drive to save disk space” on the General tab, and click Apply. This will compress all files and folders on the drive.

Enable compression using the command line

For more control or for scripting, you can use the compact command in Command Prompt or PowerShell. To compress a folder and all its subfolders, run:

compact /c /s:"C:\path\to\folder" /i

To compress an entire drive, use:

compact /c /s:"C:\" /i

The /c flag compresses, /s specifies the folder (or drive root), and /i continues even if errors occur.

How to Disable NTFS Compression

Disabling compression is just as easy. You can uncheck the “Compress contents” box in the folder’s Advanced attributes, or use the compact /u command to uncompress files.

  1. Right-click the folder or drive, select Properties, then Advanced.
  2. Uncheck Compress contents to save disk space.
  3. Click OK and then Apply. If it’s a folder, choose whether to apply to subfolders and files.

Using the command line, to uncompress a folder and its subfolders:

compact /u /s:"C:\path\to\folder" /i

To uncompress an entire drive:

compact /u /s:"C:\" /i

How NTFS Compression Works

NTFS compression works at the file system level. When a file is marked as compressed, Windows’ NTFS driver compresses the data before writing it to disk, and decompresses it when reading. The compression algorithm is similar to the one used in ZIP files (LZ77-based), but it is optimized for speed and low memory usage.

Compression is applied per file, not per block. This means that even a small file might be compressed entirely, but if a file is already compressed (like a JPEG), NTFS will skip compression because it would not save space. Windows uses a heuristic: if the file is smaller than a certain size (typically 4KB) or if the first few bytes indicate it’s already compressed, it may not compress it.

One key aspect is that compression is not applied to the Master File Table (MFT) or to system files that are already compressed. Also, NTFS compression is only available on NTFS volumes; it does not work on FAT32 or exFAT drives.

When to Use NTFS Compression

NTFS compression is most beneficial for files that are highly compressible, such as text documents, spreadsheets, XML files, log files, and uncompressed images (like BMP). If you have a lot of these types of files, compression can save significant disk space.

It is also useful for SSDs (solid-state drives) that are running low on space, but with a caveat: compression adds CPU overhead, which can slightly reduce performance. On modern CPUs, the impact is often negligible for everyday use, but for heavy I/O operations, it might be noticeable.

However, you should avoid enabling compression on folders that contain already-compressed files (like MP4, MP3, ZIP, JPEG, PNG) because you will not gain space and you will add overhead. Also, avoid compressing system folders like C:\Windows or C:\Program Files, as it can slow down boot and application loading, and may cause issues with some software.

Pros and Cons of NTFS Compression

Here are the main advantages and disadvantages of using NTFS compression:

  • Pros:
    • Saves disk space for compressible files.
    • Transparent to users and applications.
    • No need to manually zip/unzip files.
    • Works on any NTFS drive, including external drives.
  • Cons:
    • Adds CPU overhead when reading/writing compressed files.
    • May reduce performance on older or slower CPUs.
    • Does not compress already-compressed files (no benefit).
    • Not available on non-NTFS file systems.
    • Can cause issues with some backup or sync tools that don’t handle compressed files well.
    • Encrypted files cannot be compressed (Windows uses EFS, and compression and encryption are mutually exclusive).

Common Problems and Misconceptions

One common misconception is that NTFS compression is the same as “compressed folders” (ZIP folders). That is not true; ZIP folders are just archives, while NTFS compression is a file system attribute.

Another issue is that some users think compression will speed up their system because files are smaller. In reality, compression can slow down performance because the CPU has to work to decompress data. On modern systems with fast CPUs and SSDs, the difference is often minimal, but on older hardware or with large files, it can be noticeable.

If you compress a folder and then move or copy files to another location, the compression attribute may or may not be preserved. When copying within the same NTFS volume, the attribute is usually preserved. When copying to a different volume, the file is written as uncompressed unless the destination folder has compression enabled.

Another problem: if you compress a drive that contains the Windows system files, you might experience slower boot times and system sluggishness. It is generally not recommended to compress the entire system drive, especially if it’s an SSD, because the performance hit may outweigh the space savings.

Alternatives to NTFS Compression

If you need more aggressive compression or want to compress files for archiving, you might consider using a tool like 7-Zip or WinRAR to create ZIP or 7z archives. These can achieve better compression ratios, especially for text files, but they are not transparent—you have to manually extract files to use them.

Another alternative is to use Windows’ built-in “Compressed (zipped) Folder” feature, which creates a ZIP archive. This is useful for sharing or storing files, but again, it is not transparent.

For SSDs, you could also consider using the “Storage Sense” feature in Windows to automatically free up space by deleting temporary files or moving files to OneDrive. Or you could use the “Compact OS” feature (compact.exe /compactos:always) which compresses system files and is optimized for Windows, but this is a separate feature from NTFS compression.

Frequently Asked Questions

Does NTFS compression work on all Windows versions?

Yes, NTFS compression has been available since Windows NT, and it works on Windows 10 and Windows 11, as well as older versions like Windows 7 and 8. It is a feature of the NTFS file system, not the OS version.

Can I compress an external drive?

Yes, you can compress an external drive if it is formatted with NTFS. However, keep in mind that the drive may be slower when reading/writing compressed files, and some devices (like smart TVs or older media players) may not support NTFS compression.

Will compression affect file integrity?

No, NTFS compression is lossless, meaning no data is lost. The file is decompressed exactly as it was before compression. However, if the disk develops bad sectors, compressed files may be more susceptible to corruption because the data is stored in a compressed form.

How can I tell if a file is compressed?

In File Explorer, you can enable the “Compressed” column in Details view, or you can check the file’s properties and look at the Advanced attributes. Compressed files are often shown in blue text in File Explorer, but you can change that in Folder Options.

Does compression work on encrypted files?

No, NTFS compression and encryption (EFS) are mutually exclusive. You cannot have a file that is both compressed and encrypted. If you try to compress an encrypted file, Windows will give an error.

Can I compress only certain file types?

NTFS compression is applied to folders and drives, not to specific file types. However, you can compress a folder that contains only the file types you want, or you can use a script to compress files with certain extensions. Windows will automatically skip files that won’t benefit from compression.