scrollgoal
Software & Systems · Guide 081

What happens to a file after you empty the trash

Emptying the trash feels final: the file vanishes and the free space goes up. For decades, the truth was that nothing had been erased at all. Then the hardware changed underneath us, and on many modern machines the old warning has quietly become the exception.

9 min read · Updated November 2026

You are selling your old laptop. Before you hand it over, you drag the folder of tax returns and scanned passports to the trash, right-click, and choose "Empty Trash." The warning says the items will be deleted permanently and that the action cannot be undone. Permanently. Cannot be undone. You close the lid and take the cash.

Or the reverse: you emptied the trash last night and this morning you realise the only copy of a project was in it. "Permanently," the dialog said. So you do not even try to get it back.

Both decisions rest on the same belief, and the belief was wrong for most of computing history. Whether it is wrong for you today depends on a piece of hardware you probably never think about.

The intuition, stated fairly

Here is the belief at full strength:

When I delete a file it goes to the trash, and I can still get it back. When I empty the trash, the computer removes it. It is no longer in any folder, no search can find it, and the free space on the drive goes up by exactly its size. The space is free because the file is gone.

Every observation in there is accurate. The file really is unreachable from every window, menu and search box on the computer. The free space really does increase. The operating system is not lying to you; from its own point of view, the file no longer exists.

The flaw is in the last sentence: the idea that space being free means the data in it is gone. Those turn out to be two different things.

The crack

Search for "undelete" and you will find dozens of free programs that promise to recover files after the trash has been emptied. On an ordinary hard disk or a camera's memory card, they often work, sometimes recovering files that were deleted months earlier. Police forensic labs and data-recovery shops have built whole businesses on the same fact.

If emptying the trash erased the file, there would be nothing for those programs to find. There is something to find because emptying the trash does not touch the file's contents at all.

The table of contents and the pages

Think of a drive as a very large notebook with a table of contents at the front. The pages hold the actual contents of your files, cut into small fixed-size blocks, often 4 kilobytes each. The table of contents, which the computer calls the file system, records every file's name, its folder, and which blocks hold its pieces. It also keeps a list of which blocks are free.

Moving a file to the trash just moves its entry from one folder to another; the Trash or Recycle Bin is a folder. Emptying the trash does two small things in the table of contents: it deletes the file's entry, and it marks the file's blocks as free. That is all. Nobody visits the pages. The bytes of your tax return sit exactly where they were, intact, in blocks now labelled "available."

This design is deliberate and sensible. Wiping the contents of a 4-gigabyte video would take real time; striking out one line in the table of contents takes almost none. The data gets erased eventually, as a side effect, when the computer happens to pick those free blocks to store something new. That might be in five minutes or never.

That is how undelete tools work. They read the free blocks directly, ignoring the table of contents, and look for recognisable file contents. A JPEG photo starts with a distinctive sequence of bytes; so do PDFs and Word documents. Find the start, follow the data, and you have the file back. This is called file carving.

What "Empty Trash" changes, on a hard disk table of contents: entry for taxes.pdf → removed free-block list: blocks 81,204–81,331 → marked free blocks 81,204–81,331: the PDF's bytes → unchanged Illustrative block numbers. The free-space counter goes up by the file's size, yet every byte of it is still on the disk until something new lands there.

On a hard disk, getting rid of the bytes for real means writing over them. You may have heard that this takes many passes of random data, after a famous old idea that traces of the earlier magnetic pattern could be read under a microscope. The U.S. National Institute of Standards and Technology (NIST), whose Special Publication 800-88 is the standard reference on wiping storage, now says plainly that multi-pass overwriting is unnecessary. Its current guidance describes overwriting all user-addressable space, typically in a single pass.

So for a hard disk the full picture is simple: delete hides, overwrite erases, and one overwrite is enough. Then flash storage arrived and broke both halves of that sentence.

Where "deleted means gone" is closer to right

A solid-state drive (SSD), like the storage in nearly every new laptop and every phone, stores data in flash memory chips, and flash has an odd rule: it cannot be overwritten in place. A block of flash has to be erased before it can be written again, and erasing happens in large chunks. So when you change a file, the drive writes the new version to a fresh, already-erased spot and quietly updates an internal map of where everything lives. That map is maintained by firmware inside the drive, the flash translation layer.

That has two consequences, and they point in opposite directions.

The first is bad news for anyone who learned to "shred" files. Overwriting a single file on an SSD does not overwrite the old data; the drive simply writes your random junk somewhere new and leaves the old copy in its old cells. A 2011 study by Michael Wei, Laura Grupp, Frederick Spada and Steven Swanson at the University of California, San Diego, presented at the USENIX conference on file and storage technologies, took drives apart and read the flash chips directly. They found that none of the existing hard-drive techniques for securely erasing individual files were effective on SSDs. They also found that drives' built-in erase commands were effective but sometimes implemented incorrectly, and that overwriting the drive's entire visible space twice was usually, but not always, enough.

The second consequence is the twist. Because an SSD has to manage its own free space, it badly wants to know which blocks no longer hold anything useful; otherwise it wastes effort preserving deleted data every time it shuffles things around. So modern operating systems tell it. When you empty the trash, the system sends the drive a command, usually called TRIM, listing the blocks that just became free. The drive can then stop preserving them and erase the underlying cells in the background, a housekeeping process called garbage collection.

And many modern drives, once told a block is trimmed, return zeros (or some other fixed value) if anyone asks to read it, even before the cells are physically erased. An undelete program asks the drive for the free blocks, exactly as it would on a hard disk, and gets back nothing.

CAN RECOVERY SOFTWARE READ THE DELETED FILE THROUGH THE DRIVE? in the Trash Trash emptied weeks of use whole drive erased Hard disk spinning platters SSD with TRIM most modern laptops Flash without TRIM some USB adapters, cards readable readable maybe not readable readable usually not not readable not readable readable readable maybe usually not readable by undelete tools depends what overwrote it not readable through the drive Dashed line = "Empty Trash". Hard disk: nothing changes. SSD with TRIM: recovery usually ends. typical behaviour, illustrative; backups, cloud copies and lab chip reads are outside this grid
Same click, different hardware, opposite outcomes. On a hard disk, emptying the trash only changes the table of contents, so the file stays readable until new data happens to land on it. On an SSD whose operating system sends TRIM, the drive is told those blocks are free and usually stops returning their contents. "Not readable through the drive" is not the same as physically destroyed: until garbage collection runs, a lab reading the flash chips directly might still find traces.

So on a modern laptop with an SSD, the folk belief is much closer to true than the old warnings suggest. Emptying the trash often does make the file unrecoverable by any ordinary means, and quickly. Data-recovery firms' own published explanations name TRIM as a main reason SSD recovery fails. If you grew up on stories about undelete tools rescuing everything, that is a genuine reversal.

Phones go one step further, through encryption. A modern iPhone or Android phone encrypts its storage, so the bytes on the chip are meaningless without a key. Apple's documentation says that erasing a device obliterates the keys held in a dedicated, securely wipeable area of storage and leaves all user data cryptographically inaccessible. The scrambled data may physically remain, but the only key to it is gone. NIST's guidance recognises this approach, called cryptographic erase, as a legitimate way to sanitise media.

The regime, named

"Emptying the trash erases it" is roughly right on an SSD whose operating system sends TRIM, and erasing an encrypted phone really does make its data unreadable. It is wrong on hard disks, on many USB sticks and memory cards, and on drives in external enclosures or adapters that do not pass TRIM through. And it is wrong everywhere about copies: backups, cloud sync, shared folders, email attachments and old devices all keep their own.

That last point is where most real leaks happen. Your laptop may have truly lost the tax return. The automatic backup drive, the cloud folder that synced it, and the email you attached it to three years ago did not get the message.

What to actually do

The general lesson travels. "Deleted" usually means "no longer listed," and whether it also means "no longer exists" depends on machinery several layers below the button you pressed. When a system tells you something is permanent, ask permanent from whose point of view: the menu's, the drive's, or someone with the hardware on a lab bench.

How we know this

The laptop sale, the taxes.pdf entry and its block numbers, and the grid's cell values are illustrative descriptions of typical behaviour, not measurements; real drives vary by model, firmware, operating system and connection. This guide gives no timing for garbage collection and no recovery-rate figures, because none were verified. It is a description of mechanisms, not a security certification; organisations with formal data-disposal obligations should follow NIST SP 800-88 and their own policies.

Keep readingYour computer's own maintenance tool stopped defragmenting your drive years ago, on purpose. →The password that ticked every box and fell first. →