A person deleting a photo on a smartphone, seen from behind over the shoulder.

What Happens When You Delete Something From Your Phone?

You delete a photo from your phone. It disappears from your gallery. You assume it is gone. But is it? The answer is more complicated than you might expect, and it matters more than you might think, especially if you ever sell your phone, lend it to someone, or delete something sensitive.

The short answer is this: when you delete a file on your phone, the operating system does not erase the data immediately. It marks the storage space as available for reuse, and the data remains on the storage until new data overwrites it. Most phones also move deleted photos to a trash folder for 30 days, where they can be restored. Even after the trash is emptied, the data may persist until it is overwritten. Modern phone encryption makes this less of a concern than it used to be, but the basic principle still applies: deleting is not the same as erasing.

Key Takeaways

  • When you delete a file, the operating system marks its storage space as available, but does not erase the data. The data remains until new data overwrites it.
  • Deleted photos on most phones go to a trash or “Recently Deleted” folder for 30 days, where they can be restored. After 30 days, they are removed from the trash, but the data may still be on the storage.
  • Deleted files can often be recovered with forensic tools, until the data is overwritten. This is why a factory reset alone may not be enough before selling a phone.
  • Modern phones encrypt their storage by default. A factory reset destroys the encryption keys, which makes the data effectively unreadable, a process called cryptographic erasure.
  • Deleting an app removes the app and its local data, but does not delete your account or the data the app’s company holds on its servers. You must delete the account separately.
  • Deleting a photo from your phone does not necessarily delete it from cloud backups such as iCloud or Google Photos. Check your cloud storage separately.

What “delete” actually does

To understand what happens when you delete a file, it helps to understand how your phone stores data. Your phone’s storage is divided into small units, and each file occupies a set of these units. The operating system keeps a directory, a kind of index, that records which units belong to which file.

When you delete a file, the operating system does not go to each storage unit and erase the data. That would take time and, for flash storage, would wear out the storage cells. Instead, the operating system simply removes the file’s entry from the directory and marks the storage units as available for reuse. The data itself is still there, in the storage units, but the operating system no longer knows about it, and it will not show up in your gallery or file manager.

This is why deletion is instant. Removing a directory entry takes a fraction of a second. Actually erasing gigabytes of data would take minutes. The operating system defers the real work until the storage space is needed for new data, at which point the old data is overwritten.

The analogy is a library catalog. Deleting a file is like removing a book’s entry from the catalog. The book is still on the shelf, but no one can find it through the catalog. If someone walks the shelves, they can still find the book. The book is only truly gone when it is removed from the shelf and replaced with a new book.

The trash folder: your 30-day safety net

Before the operating system even removes the directory entry, most phones move deleted photos and files to a trash folder, where they stay for a period of time before being permanently deleted.

On iPhones, deleted photos go to the “Recently Deleted” album in the Photos app, where they remain for 30 days. During that period, you can restore them with a single tap, and they return to their original location. After 30 days, they are automatically removed from the Recently Deleted album. You can also empty the album manually to delete them immediately.

On Android phones, the behavior varies by manufacturer and by app. Google Photos moves deleted photos to a Trash folder for 30 days (60 days for photos that were backed up to Google Photos). Samsung’s Gallery app has a Recycle Bin with a 30-day retention period. Other apps may have their own trash folders with different retention periods.

The trash folder is a safety net. It protects you from accidental deletions, which are common: a misplaced tap, a child playing with your phone, or a moment of inattention can delete important photos. The 30-day window gives you time to notice and recover them.

But the trash folder also means that deleting a photo does not immediately free up storage space. The photo still occupies storage until it is removed from the trash. If you are trying to free up space, you need to empty the trash as well as delete the photos.

Why deleted files can be recovered

Because deletion only removes the directory entry, the data remains on the storage until it is overwritten. This means that deleted files can often be recovered, using software that scans the storage for data that is no longer in the directory.

Forensic recovery tools, used by law enforcement and data recovery specialists, can scan the raw storage and reconstruct deleted files. The success rate depends on how much time has passed and how much new data has been written since the deletion. If you delete a photo and immediately take many new photos, the old photo’s storage units are likely to be overwritten, and recovery becomes impossible. If you delete a photo and the phone sits idle, the data may remain recoverable for weeks or months.

Flash storage, which is used in all modern phones, complicates the picture. Flash memory is organized into pages (for writing) and blocks (for erasing). Data can only be erased in whole blocks, which contain many pages. When you delete a file, the storage controller marks the affected pages as invalid, but it does not erase the block immediately. The block is erased later, during a process called garbage collection, when the controller needs free space.

The storage controller also uses wear leveling, which distributes writes evenly across the storage to prevent any single block from wearing out prematurely. Wear leveling means that new data is not necessarily written to the same physical location as the deleted data, which can prolong the time that deleted data remains on the storage.

The practical implication is that if you delete something sensitive, such as a photo you do not want anyone to see, simply deleting it is not enough to ensure it is gone. The data may persist on the storage for an indefinite period, and it could be recovered by someone with the right tools and access to your phone.

Encryption and factory resets

Modern phones have a powerful protection against data recovery: encryption. Since the iPhone 3GS and Android 10, phones encrypt their storage by default. Every file on the phone is encrypted with a key that is derived from your passcode and stored in a secure hardware component.

Encryption changes the deletion equation. When data is encrypted, deleting the encryption key is equivalent to deleting the data. The encrypted data may still be on the storage, but without the key, it is unreadable, a meaningless string of random characters. This is called cryptographic erasure.

When you perform a factory reset on a modern encrypted phone, the phone destroys the encryption keys. The data on the storage becomes permanently unreadable, even though it has not been physically erased. The factory reset also removes the directory entries and, on most phones, triggers a TRIM operation that tells the storage controller to erase the blocks. The combination of key destruction and block erasure makes data recovery effectively impossible.

This is why a factory reset is the recommended step before selling or giving away a phone. On a modern encrypted phone, a factory reset is sufficient to protect your data. On an older phone that was not encrypted by default, a factory reset alone may not be enough, and you should encrypt the phone before resetting it, or overwrite the storage with dummy data first.

The Federal Trade Commission (FTC) recommends that you back up your data, sign out of all accounts, remove the SIM card and any memory cards, and perform a factory reset before disposing of a phone. The National Institute of Standards and Technology (NIST) provides detailed guidance on media sanitization in its Special Publication 800-88, which covers the proper methods for clearing, purging, and destroying data on electronic devices.

How to truly delete something

If you want to ensure that a specific file is truly gone, not just removed from the directory, there are several steps you can take.

First, delete the file and empty the trash. This removes the file from the directory and from the trash folder, which is the minimum step. The data may still be on the storage, but it is no longer accessible through the normal interface.

Second, overwrite the storage. After deleting the file, fill the phone’s storage with dummy data, such as large video files, and then delete the dummy data. This increases the chance that the deleted file’s storage units are overwritten. This is not guaranteed, because of wear leveling, but it significantly reduces the chance of recovery.

Third, for a phone you are selling or giving away, perform a factory reset. On a modern encrypted phone, this destroys the encryption keys and makes the data unreadable. For extra security, you can encrypt the phone (if it is not already encrypted), perform a factory reset, set up the phone as new, fill the storage with dummy data, and perform a second factory reset. This is overkill for most situations, but it is the most thorough approach.

Fourth, check your cloud backups. Deleting a photo from your phone does not delete it from iCloud, Google Photos, or other cloud services that may have backed it up. Log in to the cloud service and delete the photo there as well. Also check whether the photo was shared with anyone, or included in a shared album, as shared copies are not deleted when you delete the original.

Fifth, for apps, remember that deleting the app does not delete your account. If you want your data removed from the app’s servers, you must delete your account through the app’s settings or by contacting the company. Many apps make this difficult, but under laws such as the California Consumer Privacy Act (CCPA), you have the right to request deletion of your personal data.

Frequently asked questions

Can the police recover deleted files from my phone? Law enforcement agencies have forensic tools that can recover deleted files from phones, particularly if the phone is not encrypted or if they have the passcode. On a modern encrypted phone with a strong passcode, recovery is much more difficult. The legal aspects of phone searches are complex and vary by jurisdiction.

Does emptying the trash free up storage space? Yes, but not immediately in all cases. Emptying the trash removes the files from the trash folder, which marks their storage as available. The storage space becomes available for new data, but the old data may still be physically present until it is overwritten. The reported free space should increase after emptying the trash.

What happens when I delete a text message? Deleted text messages are removed from the messaging app, but they may remain in backups, on the carrier’s servers, or on the recipient’s phone. On iPhones, deleted messages go to a “Recently Deleted” folder for 30 days. On Android, the behavior varies by messaging app. Deleting a message from your phone does not delete it from the recipient’s phone.

Should I delete apps I do not use? Yes. Unused apps take up storage space, may run background processes that drain the battery, and may collect data. Deleting an app removes the app and its local data. If you want to stop the app’s company from retaining your data, delete your account before deleting the app.

Is a factory reset enough before selling my phone? On a modern phone with encryption enabled by default (iPhone 3GS and later, Android 10 and later), a factory reset is sufficient, because it destroys the encryption keys. On an older phone, encrypt the phone first, then perform the factory reset. Also remove the SIM card and any memory cards, and sign out of all accounts before resetting.

Sources and further reading

  • Federal Trade Commission: ftc.gov: guidance on disposing of mobile devices, protecting your data, and what to do before selling or recycling a phone.
  • National Institute of Standards and Technology: nist.gov: media sanitization guidelines (SP 800-88), covering the proper methods for clearing, purging, and destroying data.
  • Cybersecurity and Infrastructure Security Agency: cisa.gov: data protection guidance, device security tips, and best practices for individuals.

For more on how the devices and networks around you work, see how the internet and your devices actually work. Software updates are covered in why do software updates take so long, and public Wi-Fi safety in is hotel Wi-Fi safe. Our Tech & Security section covers more of it.

This article is for general educational and informational purposes only and is not financial, legal, insurance, tax, or medical advice. Always consult a qualified professional regarding your specific situation.

More From Author

A person waiting while a laptop installs a software update, seen from behind over the shoulder.

Why Do Software Updates Take So Long?

A person unlocking a phone with face recognition, seen from behind over the shoulder.

How Does Facial Recognition Actually Work?

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts