What does defragmenting get rid of?

Defragmenting, also known as defragging, is the process of reorganizing the contents of your computer’s hard drive to improve performance. When files are created, edited, or deleted over time, the remaining data can become fragmented across different locations on the hard disk. Defragmenting consolidates these fragmented pieces of data into contiguous blocks to optimize read/write speeds.

Does defragmenting delete files?

No, defragmenting does not delete or remove any files from your hard drive. The process simply rearranges data on the disk so that the files are stored closer together in a more optimized way. All your files and folders will remain intact after a defrag.

What types of fragmentation does defragging fix?

There are two main types of fragmentation that defragmenting addresses:

File Fragmentation

This occurs when a single file is broken up and scattered in pieces across different locations on the hard drive. Defragmenting consolidates all fragments of a file together in one place.

Free Space Fragmentation

This happens when there are many small gaps of free space throughout the hard drive. Defragmenting shifts around data to combine all the free space into larger contiguous blocks.

How does defragmenting improve performance?

Defragmenting boosts performance in a few key ways:

  • Faster file access – Since files are stored closer together in a consolidated manner, the hard drive head doesn’t need to mechanically move as far to access all the fragments of a file.
  • Quick saving and loading – Programs can write files to disk faster when there are large blocks of free space available.
  • More efficient OS reads – The operating system performs reads more efficiently when data is arranged sequentially rather than scattered all over.

What gets removed during defragmentation?

Defragmentation does not directly delete or remove anything from the hard drive. However, the following types of data may get cleared out or overwritten as a side effect:

Invalid and Orphaned File Fragments

Sometimes file fragments can become orphaned or invalid if the original file gets deleted or corrupted. The defrag process will clear out these useless orphan fragments.

Temporary Files

Many temporary internet, system and app files get overwritten as part of consolidation. These typically get recreated as needed.

Free Space

Unused free space clusters get reused and overwritten with consolidated data fragments. So while total free space remains the same, the exact composition of empty space gets rewritten.

Swapped Out Memory Contents

Defragmenting may clear overwritten areas of the swap file or pagefile.sys that contain previously swapped out memory contents.

What gets better organized?

Defragmenting improves the organization of the key contents on your hard drive:

  • Files – File fragments are consolidated so each file occupies contiguous clusters.
  • Free Space – All the free space is consolidated into a few large contiguous blocks.
  • System Files – Critical OS system files used at boot up are organized sequentially on disk.
  • File Tables – The file allocation table or metadata is better optimized to locate files faster.

Will defragmenting speed up my computer?

Defragmenting can provide a noticeable speed boost for hard disk drives. Benefits are most apparent for highly fragmented drives and may include:

  • Faster boot up times
  • Quicker file searches and access
  • Speedier program launches
  • Snappier installations
  • Improved data read/write speeds

For SSD drives, defragmenting is not recommended as it can actually shorten the lifespan due to excessive writes. SSDs do not experience fragmentation issues to the same extent as HDDs.

How often should you defragment your computer?

For traditional HDDs, monthly defragmentation is usually recommended for active systems. The optimal frequency depends on factors like:

  • Drive usage – Heavily used systems need more frequent defrags
  • Fragmentation levels – Highly fragmented drives should be defragged more regularly
  • Drive capacity – Larger HDDs tend to fragment faster
  • File types – Certain files like photos, videos are more fragmenting

For SSDs, defragmenting is unnecessary. TRIM and garbage collection processes already optimize these drives automatically.

Does defragmenting improve computer security?

Defragmenting can provide moderate security benefits:

  • Clears out orphaned file fragments that could potentially store residual sensitive data
  • Overwrites and resets the composition of free space on the disk
  • Reduces chances of data leaks from fragmented files

However, defragging should not be used as a secure delete method when permanently removing sensitive files. More thorough disk wiping is required to sanitize drives.

Can you recover files after defrag?

Files deleted prior to a defrag can still often be recovered using file recovery software. During defragmentation:

  • File contents are consolidated but remain intact
  • Only the presence or location of file fragments is altered
  • Actual data being stored is not changed or overwritten

However, heavy file fragmentation prior to deletion can make full file recovery more difficult. Defragging optimizes this scenario by coalescing all fragments.

Is defragmenting necessary for SSDs?

Defragmenting is generally not recommended for SSD drives for a few reasons:

  • SSDs don’t experience fragmentation issues to the same extent as HDDs
  • SSDs handle random writes much better – sequential order provides little benefit
  • The defrag process can shorten SSD lifespan by causing extra writes

TRIM, wear leveling, and garbage collection keep SSDs optimized automatically in the background. Manual defrags provide negligible improvement.

Can defragmenting delete viruses?

Defragmenting does not directly detect or remove viruses or other malware. However, it may overwrite infected file fragments as a side effect, making them no longer accessible. Specifically:

  • Orphaned fragments of infected files can get cleared out
  • Infected files split up in fragments can get consolidated
  • Unused spaces containing malware can get overwritten

This can make previously infected files appear clean after a defrag. But other dormant malware traces may remain elsewhere. Defragging should not be relied on for virus removal – use a dedicated antivirus program.

Does a full defrag take a long time?

Full defragmentation of a very large and heavily fragmented hard drive can take several hours to complete. Factors affecting defrag time include:

  • Total disk space – Larger drives take longer
  • Fragmentation levels – Heavily fragmented disks require more work
  • Drive speed – Faster HDDs defrag quicker
  • System resources – Background activity during defrag can prolong the process
  • Defrag program – Some tools are more optimized for faster defrags

However, scheduling the process overnight allows defragmentation to complete without slowing down your workflow. Incremental and optimized defrags are also faster alternatives.

Does defragging reduce computer lifetime?

For traditional HDDs, defragmenting actually extends the usable lifetime by:

  • Optimizing drive operations and reducing wear on components
  • Allowing drives to operate cooler by reducing fragmented access
  • Clearing out invalid orphaned file fragments that can cause bad sectors

However, excessive defragmenting of SSDs can potentially shorten lifespan due to extra writes. But for HDDs, regular defragmentation provides benefits that improve longevity.


Defragmenting reorganizes fragmented data on your hard drive so that files are stored contiguously for optimal performance. The process does not delete or remove any user files. However, it may overwrite useless temporary and orphaned file fragments, consolidate free space clusters, and reset the contents of pagefile/swapfile areas. Defragmenting is recommended for HDDs but generally unnecessary for SSDs. Remember to always backup important data before conducting any drive optimization procedures.