How To Wipe A Disk With DiskPart Clean In Windows 11 (2026)
The DiskPart clean command wipes a drive’s partition information so you can start over with an empty disk.
It is permanent and it acts on whichever disk you select, so the most important step is picking the right disk number.
The steps below follow Microsoft’s DiskPart, clean and Clear-Disk pages.
Table of Contents
Quick answer
| Goal | Command |
|---|---|
| Remove all partitions and formatting | clean |
| Also zero every sector | clean all |
| Same job in PowerShell | Clear-Disk -Number 1 -RemoveData |
Use the DiskPart commands below in this order: list disk, select disk, then clean.
Read this before you run anything
Microsoft says clean removes any and all partition or volume formatting from the disk with focus.
Check the disk number with list disk before you run clean or clean all, because both destroy data.
Disconnect any external drive you do not want to touch, and back up anything you need first.
If you only want to change one volume, see our guide to partitioning a hard drive in Windows 11 instead of wiping the whole disk.
Open DiskPart
- Search for Command Prompt or Terminal in the Start menu and choose Run as administrator.
- Type diskpart and press Enter.
Microsoft says you must be in your local Administrators group, or a group with similar permissions, to run DiskPart.
Clean the disk with DiskPart
- Type list disk and press Enter to see every disk.
- Find the disk by its size, because the disk number is what you need.
- Type select disk 1, replacing 1 with your disk number, and press Enter.
- Type detail disk to check the selected disk before you go on.
- Type clean and press Enter.
- Type exit to leave DiskPart.
Microsoft says a disk must be selected for clean to work, and that an asterisk appears next to the disk that has focus in the list.
Focus stays on a disk until you select something else, so check it again if you run other commands first.
clean versus clean all
| Command | What Microsoft says it does |
|---|---|
| clean | Removes all partitions or volume formatting from the disk with focus |
| clean all | Sets each and every sector on the disk to zero, which completely deletes all data on the disk |
Microsoft’s page does not say how long clean all takes, and writing zeros to every sector of a large drive is a slow job.
Use plain clean when you want a blank disk, and use clean all when you want the data completely overwritten.
What clean overwrites on MBR and GPT disks
| Disk type | What clean overwrites |
|---|---|
| MBR | Only the MBR partitioning information and hidden sector information |
| GPT | The GPT partitioning information, including the Protective MBR, and there is no hidden sector information |
To check which style a disk uses before you wipe it, see our guide to converting MBR to GPT.
After cleaning the disk
A cleaned disk has no partitions, so it will not appear in File Explorer until you set it up again.
Open Disk Management and follow our guide to setting up a new drive in Windows 11 to initialize it and create a volume.
If you only need a USB flash drive erased, our guide to formatting a USB drive is the gentler option.
Clean a disk with PowerShell
Microsoft’s clean page points to the Clear-Disk cmdlet as the PowerShell version of the command.
| Command | What Microsoft says it does |
|---|---|
| Clear-Disk -Number 1 | Clears disk 1 only if it has no data or OEM partitions |
| Clear-Disk -Number 1 -RemoveData | Clears the disk if it has data partitions, but not if it also has OEM partitions |
| Clear-Disk -Number 1 -RemoveData -RemoveOEM | Clears the disk whether it has data or OEM partitions |
Microsoft says Clear-Disk removes all partition and volume information and un-initializes the disk, which erases all data on it.
It also offers -WhatIf to preview what would happen and -Confirm to be asked before it runs.
Without -RemoveOEM, the cmdlet will not clear a disk that has OEM recovery partitions, which is a useful safety stop on a PC’s main drive.
If the clean does not work
| Problem | What to check |
|---|---|
| Nothing happens or an error appears | Make sure a disk is selected, because Microsoft says clean fails without one |
| Access is denied | Open the window as administrator |
| You cannot clear a disk in PowerShell | Add -RemoveData, and add -RemoveOEM if it has OEM recovery partitions |
| Wrong disk selected | Run list disk again and select the right number before you clean |
Official sources
More Windows guides
- How To Perform A Clean Boot In Windows 11 (2026)
- How To Free Up Disk Space On Windows 11 (2026)
- How To Mount And Unmount An ISO File In Windows 11 (2026)
- How To Change The Default OS In The Windows Boot Menu (2026)
- How To Create And Mount A VHD In Windows 11 (2026)
- How To Suspend BitLocker In Windows 11 (2026)