How to Erase or Wipe a Hard Drive in Windows

Need to erase a disk? Learn three Windows ways to wipe it and how to free space without wiping.

Fact-checked Reviewed by Aswin Vijayan Updated November 2, 2026 Based on 4 sources
Summary

Three Windows tools can erase a disk. Reset this PC wipes the system disk. Format with the P switch overwrites a data volume. Diskpart clean all zeroes every sector. Check the disk number twice because both commands remove all data.

You want to clear a disk before you sell it or reuse it. Windows has built in tools for this.

Some readers want free space instead. Free space needs a different method that the last section shows.

How do You Erase a Hard Drive in Windows?

MethodBest ForErases
1. Reset this PCThe system disk of a working PCFiles, apps and settings
2. format with /pA data volumeEvery sector on the volume
3. diskpart clean allAn entire diskEvery sector on the disk

Back up your files first. Wiped disks have no files and no Windows until you reinstall.

How do You Wipe the System Disk With Reset This PC?

Microsoft states that Remove everything removes personal files, apps and settings. Clean data removes files and cleans the disk, takes longer and makes removed files harder to recover. See resetting your PC.

  1. Open Settings then System then Recovery.
  2. Under Recovery options select Reset PC.
  3. Select Remove everything.
  4. Enable Clean data and follow the on screen instructions.

Microsoft notes that this erasure doesn't meet government and industry standards. For sensitive disks see how to dispose of a hard disk securely.

How do You Overwrite a Volume With the Format Command?

Microsoft documents format with the /p switch. It zeroes every sector on the volume and then overwrites the volume with a different random number on every pass. Quick format with /q only deletes the file table and root directory and overrides /p. See format reference.

  1. Open Command Prompt as administrator.
  2. Replace E with the letter of the volume you want to erase.
  3. Enter the command and answer Y at the warning.
Command Prompt (Admin)
:: Erase volume E with one overwrite pass
format E: /fs:ntfs /p:1

Microsoft states that you must belong to the Administrators group. For a hard disk the prompt warns that all data will be lost.

How do You Zero an Entire Disk With diskpart?

Microsoft states that clean removes partition and formatting information and doesn't zero the disk. clean all sets every sector to zero and deletes all data. See diskpart clean.

Command Prompt (Admin)
diskpart
:: Identify the disk by its size
list disk
:: Replace 1 with your disk number
select disk 1
:: Zero every sector
clean all
exit

Microsoft notes that clean acts on the disk with focus. Confirm the disk number with list disk before you enter the command. Wiping the wrong disk erases its data. Large disks take much longer.

What if You Only Need Free Space?

Wiping is the wrong tool then. Open Settings then System then Storage and review Temporary files. Microsoft states that Previous Windows Installation(s) appears there and removing it deletes the old Windows files. See Storage Sense guidance.

For more options see free disk cleanup tools for Windows. Unused apps also take space. See how to uninstall stubborn programs in Windows.

Frequently Asked Questions

How do I Erase a Hard Drive in Windows?

Use Reset this PC with Remove everything and Clean data for the system disk. Use format with the p switch for a volume or diskpart clean all for an entire disk.

Does diskpart Clean Erase Data?

Not fully. Microsoft states that clean removes partition and formatting information and doesn't zero the disk. Clean all zeroes every sector.

Does Quick Format Erase My Data?

No. Microsoft states that quick format only deletes the file table and root directory. Use the p switch to overwrite sectors.

Can I Wipe a Hard Drive Without Reinstalling Windows?

Yes for a data volume or a second disk. Wiping the system disk removes Windows. You reinstall afterward.

Is Reset This PC Enough for Selling a PC?

It is a first step. Microsoft states that the erasure doesn't meet government and industry data erasure standards.

How do I Free Space Without Wiping the Disk?

Review Temporary files in Storage settings and remove apps you don't use. Wiping erases everything.

Key Takeaways

  • Back up your files before any erase.
  • Reset this PC with Clean data wipes the system disk.
  • Overwriting a volume needs the p switch because quick format does not.
  • Diskpart clean all zeroes every sector and plain clean does not.
  • Confirm the disk number before you enter any wipe command.

Sources and References

This guide follows Microsoft documentation.

  1. Reset Your PC (Microsoft Support) support.microsoft.com
  2. format (Microsoft Learn) learn.microsoft.com
  3. clean (Microsoft Learn) learn.microsoft.com
  4. Manage Drive Space With Storage Sense (Microsoft Support) support.microsoft.com