Where do deleted files go on my computer?

When you delete a file on your computer, it may seem like it’s gone for good. However, that’s not necessarily the case. Deleted files don’t just vanish into thin air, they are still present on your hard drive until the space they occupied is overwritten by new data. Understanding what happens to deleted files and where they go can help you better manage your digital storage and keep your data secure.

Files are not completely erased when deleted

When you delete a file, either by hitting delete, dragging the file to the recycle bin, or using the Shift+Delete keyboard shortcut, you are simply removing the pointer that tells the operating system (OS) where that file is located on the hard disk. The 1s and 0s that make up the file are still present on the hard drive.

Think of it like removing a book from a library catalog. The record of the book is deleted from the catalog, but the actual book still sits on the shelf until someone comes along and re-shelves it. Similarly, deleting a file just removes it from the file table, but not the hard drive.

Deleted files go to the Recycle Bin or Trash

When you delete a file or folder in Windows, it gets sent to the Recycle Bin. The Recycle Bin acts like a temporary holding area for deleted files, keeping them easily recoverable until the space is needed for more data. Anything in the Recycle Bin remains in its original location on the hard drive until permanently deleted.

On Mac OS, deleted files are sent to the Trash. It serves the same purpose as the Windows Recycle Bin. Files stay in the Trash until it is emptied, either automatically or manually. The Trash preserves the original file path.

Recovering deleted files

As long as the Recycle Bin or Trash hasn’t been emptied, you can often recover deleted files easily:

  • Windows – Open the Recycle Bin and restore the file to its original location.
  • Mac OS – Go to the Trash folder and put the file back where it was originally.

Even if you’ve emptied the Recycle Bin, third-party utilities may be able to dig the file out until it gets overwritten with new data.

Shift+Delete bypasses Recycle Bin

Using the Shift+Delete keyboard shortcut when deleting a file will bypass the Recycle Bin in Windows. The file is immediately removed from the file table and marked as free space on the drive. At this point, recovery becomes difficult, but possible in some cases.

Where files are physically stored

A computer’s hard disk drive consists of circular platters coated in magnetic material that store data as tiny magnetized and demagnetized regions across the platters’ surfaces. The OS keeps a record of where files are located in the form of clusters and sectors.

When a file is deleted, the OS simply marks its clusters as available for new data. The contents remain intact until overwritten.

Files can be spread across non-contiguous clusters anywhere on the disk. The OS tracks all the clusters that make up a single file. When a file is deleted, those clusters are marked as available even though the data remains in place.

New data overwrites deleted files

When space is needed to store new data, the OS will start overwriting the clusters formerly occupied by deleted files. Any data in those clusters gets destroyed by the new data being written on top of it. Once file clusters are overwritten, the original deleted files are virtually impossible to recover.

The more a drive is used, the less likely deleted files can be recovered. With new data constantly being written, previously deleted files get overwritten at a faster rate.

Secure delete

If completely wiping a file from a drive is desired, most operating systems include a “secure delete” option that overwrites the file’s clusters before deleting it. This replaces the actual data with random bits to prevent recovery and ensure confidential data isn’t leaked.

Physical destruction

The only way to guarantee a file is completely erased from a drive is to physically destroy the drive. Drilling holes through the platters, crushing the drive or degaussing it (exposing it to a strong magnetic field) will render all data unrecoverable. Most consumers and businesses do not need to go to this extreme.

Reformatting or partitioning drives

Reformatting or repartitioning a hard drive will essentially erase and rearrange all the data on a drive. This makes recovery of original deleted files almost impossible. The drive is wiped clean and rewritten from scratch.

Securely wiping free disk space

In addition to securely deleting specific files, many tools also provide a way to overwrite the remaining free space on a hard drive. This helps eliminate any lingering sensitive data in cluster that may have previously held deleted files.

Encrypting your hard disk

One way to protect deleted files against recovery is to encrypt your entire hard disk. Encrypting the whole drive will scramble all the data, including any traces left by deleted files in free clusters. The data will be unreadable and unrecoverable without the encryption key.

Conclusion

While deleting files may give the impression that they are gone forever, that is often not the case. Data recovery is possible until the file clusters are overwritten with new data. To prevent deleted files from being recovered, make sure to empty the Recycle Bin and Trash and consider utilizing secure delete options. The only way to fully eliminate deleted data is to physically destroy the disk or overwrite the free space on the drive.