• ARTICLES
SEARCH

How-To Geek

How to Use NTFS Compression and When You Might Want To

image

The NTFS file system used by Windows has a built-in compression feature known as NTFS compression. With a few clicks, you can compress files, making them take up less space on your hard drive. Best of all, you can still access the files normally.

Using NTFS compression involves a trade-off between CPU time and disk activity. Compression will work better in certain types of situations and with certain types of files.

Trade-Offs

NTFS compression makes files smaller on your hard drive. You can access these files normally – no need for cumbersome zipping and unzipping. Like with all file compression systems, your computer must use additional CPU time for decompression when it opens the file.

However, this doesn’t necessarily mean it will take any longer to open the file. Modern CPUs are very fast, but disk input/output speeds haven’t improved nearly as much. Consider a 5 MB uncompressed document – when you load it, the computer must transfer 5 MB from the disk to your RAM. If that same file were compressed and took up 4 MB on the disk, the computer would transfer only 4 MB from the disk. The CPU would have to spend some time decompressing the file, but this will happen very quickly – it may even be faster to load the compressed file and decompress it because disk input/output is so slow.

On a computer with a slow hard disk and a fast CPU – such as a laptop with a high-end CPU but a slow, energy efficient physical hard disk, you may see faster file loading times for compressed files.

This is especially true as NTFS compression isn’t very aggressive in its compression. A test by Tom’s Hardware found that it compressed much less than a tool like 7-Zip, which reaches higher compression ratios by using more CPU time.

When To Use and When Not to Use NTFS Compression

NTFS compression is ideal for:

  • Files you rarely access. (If you never access the files, the potential slow-down when accessing them is unnoticeable.)
  • Files in uncompressed format. (Office documents, text files, and PDFs may see a significant reduction in file size, while MP3s and videos are already stored in a compressed format and won’t shrink much, if at all.)
  • Saving space on small solid state drives. (Warning: Using compression will result in more writes to your solid state drive, potentially decreasing its life span. However, you may gain some more usable space.)
  • Computers with fast CPUs and slow hard disks.

NTFS compression should not be used for:

  • Windows system files and other program files. Using NTFS compression here can reduce your computer’s performance and potentially cause other errors.
  • Servers where the CPU is getting heavy use. On a modern desktop or laptop, the CPU sits in an idle state most of the time, which allows it to decompress the files quickly. If you use NTFS compression on a server with a high CPU load, the server’s CPU load will increase and it will take longer to access files.
  • Files in compressed format. (You won’t see much of an improvement by compressing your music or video collections.)
  • Computers with slow CPUs, such as laptops with low-voltage power-saving chips. However, if the laptop has a very slow hard disk, it’s unclear whether compression would help or hurt performance.

How to Use NTFS Compression

Now that you understand which files you should compress, and why you shouldn’t compress your entire hard drive or your Windows system folders, you can start compressing some files. Windows allows you to compress an individual file, a folder, or even an entire drive (although you shouldn’t compress your system drive).

To get started, right-click the file, folder, or drive you want to compress and select Properties.

image

Click the Advanced button under Attributes.

image

Enable the Compress contents to save disk space check box and click OK twice.

image

If you enabled compression for a folder, Windows will ask you whether you also want to encrypt subfolders and files.

image

In this example, we saved some space by compressing a folder of text files from 356 KB to 255 KB, about a 40% reduction. Text files are uncompressed, so we saw a big improvement here.

Compare the Size on disk field to see how much space you saved.

image

Compressed files and folders are identified by their blue names in Windows Explorer.

image

To uncompress these files in the future, go back into their advanced attributes and uncheck the Compress checkbox.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 01/9/13

Comments (13)

  1. Michel

    What will happen if you compress something like your dropbox folder or any other cloud services?
    Will the data be compressed only locally or the “actual” size in the cloud as well?

    Greetings,

    Michel

  2. LadyFitzgerald

    Is NTFS compression lossy, like mp3s for example?

  3. Roman Berry

    @Michael and @LadyFitzgerald, this article by Daniel Rutter from back in 2008 makes a good companion piece to this HTG writeup and I think you’ll both find your answers (and then some) there. Rutter writes with some snark, but he’s very informative. See “Thrilling tales of NTFS compression” at http://www.dansdata.com/ntfscompression.htm

    Short answers? Michael, NTFS compression is only local. When you copy data from an NTFS compressed drive or folder to another drive or location, it is decompressed on read and the copy (like whatever you load to Dropbox) is not compressed. This is drive level stuff.

    LadyFitzgerald, no, this isn’t that kind of compression. No data is discarded as with MP3′s. The decompressed file is exactly the same as the original.

  4. Dan Dar3

    NTFS compression doesn’t alter the data itself, it just writes a compressed version of it down on disk, and decompresses it on the way back when a read is requested. This is done transparently by the OS at the file sub-system level, so from your application or even the rest of OS point of view, they are working with the original, uncompressed version of a file.

    http://en.wikipedia.org/wiki/NTFS#File_compression

  5. Frank

    @Michel: Only the files on your local disk will be compressed, since it’s the file system of the physical disk that compresses the files.

    @LadyFitzgerald: Nope, it’s lossless. Lossy would be a very very bad idea, you do not want information/data to disappear from your Word/Excel files if they are stored on the disk.

    And for my 2 cents:
    I do use NTFS compression for my disk with already compressed files (video files). On a 2TB disk this provides a extra 6GB on storage space, enough for a whole season of some tv series. So the bigger the disk, the more useful NTFS compression becomes for already compressed files.

  6. Yu

    Doesn’t NTFS compression automatically skip files in compressed file formats? I remember reading somewhere[1] that it does.

    Interestingly though I found that NTFS-compressed jpg files have byte-exact equal “size” and “size on disk” while for uncompressed files “size on disk” is always larger due to differen kinds of overhead. A small “.txt” file in the same folder was shown “size 7 Bytes”, “size on disk 4.00 KB (4.096 Bytes)” i.e. exactly one block file size both with and without compression. To me this seems to indicate that “size on disk” did not include file-system overhead. The exact match for compressed jpg files is probably a mis-report by windows.

    @Michel: Only locally. The compression happens on a file-system level and should be entirely hidden from higher level software, unless explicitly queried for.

    @LadyFitzgerald: Lossless. For generic file compression lossy compression wouldn’t even make sense.

    [1] Yes I know. “Somewhere” is not a good reference.

  7. dragonbite

    You mention not compressing MP3s and video, but what about digital pictures? Most of my pictures are stored as .JPEG but the file sizes are big (close to 4MB each). If I could get these to be smaller, that would be great.

    On a different machine, it is older (Pentium M @ 1.8Ghz, 2GB Ram) and with a fairly small IDE (not SATA) hard drive. Would the compression help (slow hard drive) or would it not be worth it because of the slow chip (1.8Ghz, single core)?

  8. ron

    FYI the “new”, Office 2007 “x-file” formats, DOCX XLSX PPTX etc are compressed. They use ZIP compression. If you change the file extension to .ZIP (I like to just append the .zip) you can navigate through the sub elements and folders that compose the document structure.

    http://technet.microsoft.com/en-us/library/cc179190%28v=office.12%29.aspx

  9. Rick

    Your 40% reduction is mathematically incorrect. More like 30%. (356-255)/356.

  10. gkohio

    How about compressing virus definition files?

    If I check for viruses in the middle of the night who cares if it takes a little longer for the av software to work? Or would it cause too many problems?

  11. Hillmi

    Ohk this maybe off topic but I can’t seem to find an answer anywhere.
    If you encrypt a few jpegs and then your windows goes bezerk you re install windows but don’t use the same credentials is that encrypted jpegs still accessible? How can I access them again? Is there a way to remove the windows encryption?

  12. Jon

    What happens if the hard drive is removed and used on another PC?

    For example compressed on Windows 7, but HDD taken out as machine is faulty and I want data to be recovered on WIn8 or WinXp machine. Will it be ok?

  13. Romberry

    @Jon: “For example compressed on Windows 7, but HDD taken out as machine is faulty and I want data to be recovered on WIn8 or WinXp machine. Will it be ok?”

    Yes, your data will be OK on any machine that is using an OS capable of working with NTFS files. NTFS is for all intents and purposes utterly transparent to the OS and therefore to the end user. Swap drives between machines with an NTFS capable OS to your heart’s content without worry.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!