Secure Deletion
Deleting a file almost never erases it. What you get instead is a note to the operating system that the space the file used is now free to reuse - the data itself stays exactly where it was until something else happens to be written over it. Free recovery tools can pull it back in minutes. This article covers what actually does erase data, why the answer is completely different for an old spinning hard drive than for the SSD in almost every modern computer, and the one approach that works the same on both.
The short version, if you read nothing else: encrypt first, then deletion stops mattering so much. The rest of this page explains why, and what to do when that ship has already sailed.
Why "delete" isn't "erased"
Emptying the Recycle Bin or Trash removes the file's entry from the file system's index - the table of contents, not the pages. Until those blocks get reused, the contents are still sitting on the drive, fully readable by any recovery program. On a drive with plenty of free space, "until they get reused" can mean months or years.
Two other places deleted data survives that people rarely think about:
- Copies you didn't make on purpose. Cloud sync folders, backups, email attachments you sent, the "recently deleted" folders in photo apps, and cloud trash that keeps files for 30 days or more. Wiping the local copy does nothing to any of these. See our Cloud Storage article.
- Traces of the file rather than the file. Thumbnails, recent-file lists, temp files, and Windows "shellbags" (a registry record of folders you've browsed, covered in our Encryption article) can outlive the file itself. Deleting the file touches none of them. To see which of these your own computer is holding, try the forensic tools in our Resources.
Hard drives vs. SSDs: why the rules are different
Hard drives (HDDs) - the spinning-platter kind - store data at fixed physical locations. When you overwrite a file, the new data lands on the same spot as the old data. That's why traditional "shredder" tools work on them: overwrite the spot once and the original is gone.
SSDs don't work that way. A controller inside the drive (the "flash translation layer") constantly remaps where data physically lives, and two of its jobs defeat overwriting:
- Wear leveling. Flash cells wear out after a limited number of writes, so the drive spreads writes around. When you "overwrite" a file, the controller usually writes your new data to different cells and just marks the old ones as stale. Your overwrite may never touch the original data at all.
- Over-provisioning. Every SSD holds a reserve of extra flash that the operating system can't see or address - often several percent of the drive, sometimes more than a quarter. Stale copies of your data can sit there indefinitely, and no software running on your computer can reach them.
The result: file-level overwrite tools are unreliable on SSDs. This isn't a fringe opinion - NIST's media sanitization guidance (SP 800-88), the EFF, and SSD makers themselves all say it. Apple removed "Secure Empty Trash" from macOS back in 2015 for exactly this reason. The same applies to USB flash drives and SD cards, which are flash storage with the same kind of controller, usually a cheaper one.
How do I know which kind of drive I have?
Windows: open "Defragment and Optimize Drives" from the Start menu. The "Media type" column says "Hard disk drive" or "Solid state drive". Mac: Apple menu > About This Mac > More Info > System Report > Storage (or NVMExpress / SATA); every Mac sold in recent years is SSD. Linux: lsblk -d -o name,rota - a ROTA value of 1 is a spinning disk, 0 is an SSD. Rule of thumb: a laptop from the last several years is almost certainly an SSD.
Buying an external USB drive to move sensitive files? Get a hard drive (HDD), not an SSD - and not a USB flash stick either, which has the same problem as an SSD. On a hard drive, the file tools below can actually erase a single file once you're done with it; on an SSD or flash stick, nothing can. There's a second reason: many USB enclosures block the firmware erase commands SSDs rely on, so even wiping the whole external SSD properly can be difficult. The trade-offs are that a hard drive is bigger, slower, and more fragile if dropped. Whichever you buy, encrypt it too (BitLocker To Go, VeraCrypt, or FileVault) - a drive you carry around is a drive you can lose.
The encryption-first approach (works on both)
This is the single most useful idea on this page. If data was encrypted before it ever touched the drive, every leftover fragment - in free space, in over-provisioned cells, in wear-leveled copies - is only encrypted gibberish. You no longer have to chase down every physical copy, because none of them is readable without the key.
- Whole drive: BitLocker on Windows (Pro editions; many Home laptops have a simpler "Device encryption" toggle), FileVault on a Mac, LUKS on Linux (the "encrypt" option in the installer), or VeraCrypt on any of them. Phones already do this once you set a passcode.
- Just the sensitive files: a VeraCrypt container. Everything inside it is encrypted before it's written to disk.
The honest limit, because this gets oversold: encryption protects leftovers from anyone without the key. With full-disk encryption, a deleted file's remains are still readable to anyone who can unlock the drive - you, someone who gets your password, or someone who grabs the laptop while it's on and unlocked. To make the data unreadable to everyone, the key itself has to be destroyed, which is what a cryptographic erase does (below). Encryption doesn't replace deletion; it makes deletion something you can actually get right.
Deleting individual files
On a hard drive
Overwrite tools work. One pass is enough on any modern hard drive - NIST's guidance says so, and the famous 35-pass "Gutmann method" was designed for drive technology from the 1990s. Extra passes cost you time and buy you nothing.
- Eraser (Windows) HDD yes SSD no - free, open-source, right-click "Erase" in File Explorer, plus scheduled free-space wiping.
- SDelete (Windows) HDD yes SSD no - Microsoft's free command-line tool from Sysinternals.
- shred (Linux) HDD yes SSD no - built in. Read its caveats first: it's unreliable on journaling and copy-on-write file systems (btrfs, ZFS, ext3/ext4 in some modes), which covers a lot of Linux systems.
Then wipe the free space too, which catches the leftovers of everything you deleted normally before you knew better. On Windows this is built in: cipher /w:C:\ from a Command Prompt overwrites all free space on drive C: without touching your files. Eraser can do the same on a schedule.
On an SSD
If the drive is encrypted: delete the file normally. That's it - that's the payoff from the section above.
If it isn't encrypted, there's no reliable way to erase one file on an SSD. A shredder tool plus a free-space wipe reduces the odds of recovery, but can't guarantee anything, and every pass burns through the drive's limited write life. If one file genuinely matters, the realistic options are to encrypt the drive going forward and accept that the old copy may linger, or to back up what you want to keep and erase the whole drive (next section).
Erasing an entire drive
This is for selling, donating, recycling, or repurposing a computer or drive - or starting clean.
Hard drives
A single-pass overwrite of the whole disk. ShredOS (free, bootable, actively maintained) or the older DBAN both do this well on a spinning hard drive. A Windows "full" format (not quick format) also overwrites every sector with zeros. Many drive makers include an erase function in their own utility.
To check that a wipe actually worked, run a recovery tool such as PhotoRec (in our forensic tools) on the drive afterward. On a hard drive, finding nothing is good evidence. On an SSD it's less conclusive, since recovery tools can't see the drive's reserved areas either.
SSDs
Skip overwrite tools entirely. SSDs have an erase command built into their firmware that resets every cell, including the reserved and remapped areas software can't see: ATA Secure Erase for SATA SSDs, or NVMe Sanitize / Format for NVMe drives. It's one operation, usually takes seconds to minutes, and barely touches the drive's write life.
- Manufacturer tools first, if you know the brand: Samsung Magician, Crucial Storage Executive, WD Dashboard, Kingston SSD Manager and others include a free Secure Erase for their own drives.
- Parted Magic ($15 one-time) - bootable, point-and-click, handles both ATA Secure Erase and NVMe Sanitize on any brand, and runs outside Windows so nothing is holding the drive locked.
- hdparm (Linux, free) - issues ATA Secure Erase directly. SATA only; it won't work on NVMe.
- nvme-cli (Linux, free) - issues NVMe Sanitize and Format commands, with a log to confirm it finished.
Self-encrypting drives (many modern SSDs quietly are) support a cryptographic erase: the drive throws away its internal encryption key, and everything on it becomes unreadable instantly. It's fast, causes no wear, and it's often what a "Secure Erase" button is actually doing behind the scenes.
One honest caveat: these commands are only as good as the drive maker's firmware, and security researchers have found drives that reported a successful erase without finishing the job. That's one more argument for encrypting from day one - then the firmware erase is a second layer, not your only one. If the data is truly high-stakes and the drive isn't going back into use, physical destruction settles the question.
Selling or giving away a computer
Before a computer leaves your hands, wipe the drive - even if it's going to a family member, and even if you "already deleted everything". Deleted files, saved passwords, browser sessions that are still logged in, and old documents are exactly what recovery tools are built to find, and you have no say over where the machine goes after its next owner.
If the new owner wants a working computer with the operating system still on it, don't just delete your files and hand it over, and don't hand over your own install with your accounts removed. Do it in this order instead:
- Back up everything you want to keep, and check that the backup actually opens on another device.
- Sign out and unlink your accounts so they don't stay tied to the hardware: Microsoft account and "Find my device" on Windows, Apple ID / Find My on a Mac (otherwise Activation Lock can lock out the new owner), and any software licenses that count machines (Microsoft 365, Adobe and similar).
- Make the installer first. Build a USB installer on this or another computer before you wipe anything - once the drive is erased, there's nothing left to make it from. For Windows that's Microsoft's free Media Creation Tool; for Linux, the distribution's own USB image.
- Wipe the whole drive the right way for its type, as described above: a firmware Secure Erase / Sanitize for an SSD, a one-pass overwrite for a hard drive.
- Install a clean operating system from the USB installer - just the OS, no apps, no files, no accounts. Most Windows PCs reactivate on their own, because the license is tied to the hardware.
- Stop at the first setup screen. When the fresh install gets to "choose your country or region" (or the equivalent), shut it down. The new owner starts from there and sets up their own account, just like on a new computer.
Why not just use Windows' own "Reset this PC"? Even with "Remove everything" and the drive-cleaning option turned on, it's an overwrite done from inside Windows, so on an SSD it has the same blind spots as any other overwrite tool. It's better than nothing, and fine for a hard drive going to someone you know; for an SSD, erase properly and reinstall.
Macs are the easy case. On any Mac with Apple silicon or a T2 security chip (roughly 2018 and later), System Settings > General > Transfer or Reset > Erase All Content and Settings does a cryptographic erase of your data and leaves macOS installed and ready for the next owner - it does steps 4 to 6 for you. Sign out of your Apple ID first. Older Macs: erase the drive with Disk Utility from macOS Recovery, then reinstall macOS from Recovery.
Phones and tablets
Good news for once. Modern iPhones and Android phones encrypt their storage by default once a passcode is set, and a factory reset destroys the encryption key - a cryptographic erase built into the phone. That makes a factory reset a genuinely good way to wipe a phone before selling it.
- Back up what you want to keep first, then sign out of your Apple ID or Google account before resetting (otherwise activation lock / factory reset protection will lock out the next owner).
- iPhone: Settings > General > Transfer or Reset iPhone > Erase All Content and Settings.
- Android: Settings > System > Reset options > Erase all data (the path varies by maker).
- Remove the SIM and any memory card. SD cards are not covered by the phone's reset unless you set them up as encrypted internal storage - treat them like any other flash drive.
Deleting individual files on a phone has the same SSD problem as a computer, and the phone's encryption only helps against someone who can't unlock it. See our Mobile Privacy article.
How thorough is thorough enough?
The US standard for this, NIST SP 800-88, sorts erasure into three levels. It's a useful way to decide how far to go:
- Clear - overwriting through the normal interface, so ordinary recovery software finds nothing. A one-pass overwrite on a hard drive meets this. Enough for most people selling or donating a computer.
- Purge - unrecoverable even with lab equipment. Needs firmware-level commands (Secure Erase, NVMe Sanitize) or a cryptographic erase. The right target for an SSD that held anything sensitive.
- Destroy - the drive can't be used again: shredding, drilling, crushing, incineration. For hard drives, degaussing also counts (and ruins the drive). The level for data where nothing else will do.
Myths worth unlearning
| Myth | Reality |
|---|---|
| "I emptied the Recycle Bin." | That only marks the space as free. The data is fully recoverable on both hard drives and SSDs until something overwrites it. |
| "I formatted the drive." | A quick format just resets the file system's index - the data is all still there. A full format on a hard drive does overwrite it; on an SSD it can't reach reserved or remapped cells. |
| "TRIM securely deletes data on SSDs." | TRIM tells the SSD which blocks are free so it can clean them up for speed. When (or whether) the cells actually get erased is up to the drive, and there's no guarantee. It helps; it isn't erasure. |
| "More overwrite passes are safer." | On a modern hard drive, one pass does the job. On an SSD, extra passes still can't reach wear-leveled or reserved cells and just wear the drive out faster - worse than useless. |
| "Degaussing works on anything." | Degaussers erase magnetic media. SSDs, flash drives, and phones store data as electrical charge and are completely unaffected. |
| "DBAN is the way to wipe a drive." | Still recommended everywhere in older guides. It's an overwrite tool built for hard drives - fine for those, wrong for an SSD. The same goes for ShredOS and Eraser. |
Which tool for which job
| Job | Hard drive (HDD) | SSD / flash |
|---|---|---|
| Keep future deletions safe | Turn on full-disk encryption now: BitLocker / Device encryption, FileVault, LUKS, or VeraCrypt. Works the same on both. | |
| Delete one file | Eraser, SDelete, or shred (one pass) | Encrypted drive: normal delete. Unencrypted: no reliable option - see above. |
| Clean up past deletions | cipher /w or Eraser free-space wipe | Only reliable fix is a whole-drive erase |
| Wipe the whole drive | ShredOS, DBAN, or a full format (one pass) | Manufacturer tool, Parted Magic, hdparm (SATA) or nvme-cli (NVMe) |
| Sell or give away a computer | Back up, sign out, make a USB installer, wipe the whole drive, install a clean OS with no apps. On a newer Mac: Erase All Content and Settings. | |
| Wipe a phone | Sign out of your account, then factory reset (a built-in cryptographic erase) | |
| Clear everyday traces | BleachBit for cache, history, and temp files. Not a substitute for any of the above. | |
If what you actually want is a working session that leaves nothing behind in the first place - using a public or borrowed computer, say - that's a different tool for a different job: see TAILS in our A Safer OS article.
As with everything on this site: these are the best available precautions, not guarantees. Encrypt first, erase properly when a drive leaves your hands, and remember the copies sitting in backups and the cloud.
Resources to put this to work
- VeraCrypt - free, open-source file, folder, and full-disk encryption. The encryption-first approach for any system.
- Eraser - free, open-source file and free-space wiping for Windows. Hard drives only.
- SDelete - Microsoft's free command-line secure delete for Windows. Hard drives only.
- ShredOS - free, bootable whole-drive wipe, the maintained successor to DBAN. Hard drives only.
- Parted Magic - $15 bootable toolkit for ATA Secure Erase and NVMe Sanitize on SSDs of any brand.
- BleachBit - free, open-source cleanup of cache, temp files, and other local traces.
- NIST SP 800-88 - the US government's guidelines for media sanitization, if you want the source behind Clear / Purge / Destroy.
Last updated 2026-09-26