If you're planning to sell / gift your old PC or just the drive inside, you need to secure erase your SSD or hard drive so that the next person can't gain access to your files. It almost goes without saying at this point, but simply deleting a file doesn't make it completely disappear. The operating system simply removes a pointer to the file, leaving all the bits in place, until the drive needs that space for new data and overwrites it. But that could take years or, if you have lots of free space, never happen.
You might think that simply resetting Windows 10 or 11 with the option to delete your files enabled would get rid of all your personal data, but that simply is not the case and we've done a test to prove it. I was getting ready to donate my old Windows 10 PC so I used the built-in Windows reset feature and I clicked "Remove everything," which deletes all of your files and leaves you with a factory default install of the OS.

After the reset process completed, my personal files were indeed erased as was all the software I had installed. However, after I installed and ran EaseUS Data Recovery Wizard Free (opens in new tab) , a utility that finds and undeletes files, I located all my old files. To prove my point, I recovered a file called mypasswords2.txt that had lived in the Documents folder and I was able to read everything inside of it.

No matter how nice a person you sell your computer or your bare drive to, you can't trust that they won't see what deleted files they can recover. Below we'll explain how to secure erase an SSD using Windows and then explain how to do the same to a hard drive as the process is a bit different.
How to Secure Erase an SSD
Secure erasing an SSD is different than doing the same process on a mechanical hard drive. The best way to erase an HDD, which we'll cover in more detail below, is to use a program that writes random data over all the sectors several times so that no remnants of the old files remain.
This brute-force overwrite method won't work for SSDs. Because all SSDs have a limited number of write cycles, they use overprovisioning to extend the life of the drive and replace any blocks that fail over time. So there might be 5 or 10 percent of blocks that are unavailable to the OS at any given time. A full drive overwrite wouldn't touch these blocks, which could have important data on them.
What you need is a utility which will get at all the data. Some SSD makers provide secure erase utilities for free and some motherboard BIOSes (see how to enter your BIOS ) have secure erase capability built in. However, a cheap and universal way is to use Windows 10 or 11's built-in diskpart utility at the command prompt. You can even use this method if the SSD you plan to wipe is the computer's boot drive. Here's how.
1. If the drive you are wiping is the computer's boot drive, start the computer from a Windows 10 or 11 install disk (see how to do a clean install for instructions on creating the disk). If the disk you are wiping is not the boot disk, you don't need to boot from an install disk and can perform this wipe from within Windows.
2. Launch the command prompt. If you booted off a Windows install disk, hit Shift + F10 to get the command prompt on top of the installer. If you are using your regular install of Windows, just search for "cmd," right click the top result and select "Run as administrator."

3. Enter diskpart. The prompt will now read as DISKPART>.

4. Enter list disk to see a list of all the disks attached to your PC and their numbers. If you have only one drive, it will be Disk 0.

5. Enter select disk [NUM] where [NUM] is the disk number, likely 0. So if it's disk 0, type select disk 0 .

6. Enter clean all . After several seconds or perhaps a few minutes, you will see a message telling you that the process has completed.

Your drive should now be securely wiped. If you were planning to give the computer to someone else, you can go ahead and reinstall Windows on it. When I used "clean all" to secure erase the SSD on a PC I was donating to charity, I was no longer able to see my deleted files on it using EaseUS Data Recovery.
TRIM Won't Secure Erase SSDs
Some experts claim that SSDs which have TRIM enabled -- most modern SSDs -- don't need secure erase because the process purges deleted data in the background. Unfortunately, you can't count on TRIM to purge all your blocks even if you attempt to force it by using Windows 10 or 11's Optimize Drive feature. I took the drive I'd wiped with Windows 10's reset feature and then ran Optimize Drive on it, but my sensitive files were still recoverable with EaseUS Data Recovery.
"This is an expected result from experience," DriveSavers Director of Engineering Mike Cobb told us. "TRIM doesn’t always function with all devices. This is why TRIM cannot be trusted, ever unless validated with the system and the actual drive model."
DriveSavers is a leading data recovery service that uses its own set of proprietary tools to get deleted data off of clients' SSDs and hard drives. For companies that are especially concerned about the quality of their secure erases, DriveSavers offers its " Data Erasure Verification Service (opens in new tab) ," where experts will check to make sure that nothing can be recovered.
How to Secure Erase a Hard Drive
The best way to make sure an old-fashioned mechanical hard drive is secure erased is to overwrite it with dummy data multiple times. There's a popular freeware app called DBAN (Darik's Boot and Nuke) that writes to all the sectors using secure sanitization methods.
DBAN is its own boot environment (no OS necessary) so you can use it to secure erase the boot drive on a computer without taking that drive out and attaching it to another PC. However, if the hard drive you're wiping is not the boot drive, you must be very careful when using DBAN so that you don't accidentally wipe the wrong drive.
1. Download the DBAN ISO file (opens in new tab) .
2. Write the ISO to a USB Flash drive (it only requires 20MB of space) so it becomes bootable . The easiest way to do this is by using Rufus (opens in new tab) , a free USB burning tool. Launch Rufus, click Select, choose the ISO and then click Start.

3. Boot from the DBAN USB drive. You will see a menu with a blue background and gray letters.

4. Press Enter to start interactive mode. The system will take a minute or two to detect your storage devices. A menu screen will then appear, showing all of your drives and some other options.

5. Select the drive(s) you wish to wipe. Use the J and K keys to move up and down and hit space to select the drive, which will now say "wipe" next to it.

6. Select the method of drive erasure by hitting M if you want something other than the default, DoD Short method. DoD short is a 3-pass version of the American Depart of Defense 5220.22-M wipe process. It overwrites all sectors with zeroes on the first pass, overwrites them with ones on the second pass and then uses a random pattern on the third pass.
A standard DoD 5220.22-M erasure is 7 passes. The more passes, the longer the secure erase takes. The DoD short method should be fine for most people so you can skip this step if you agree.

7. Hit F10 to start the process. Depending on the number of passes, the capacity of your drive and its speed, this could take a few minutes or several hours.

When it's complete, DBAN will show you a message stating that it has wiped all the drives you assigned to it.

Your hard drive should now be safe to give away or sell. If you plan to give away the computer with the hard drive in it, be sure to reinstall the operating system.

