|

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

GoalCommand
Remove all partitions and formattingclean
Also zero every sectorclean all
Same job in PowerShellClear-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

  1. Search for Command Prompt or Terminal in the Start menu and choose Run as administrator.
  2. 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

  1. Type list disk and press Enter to see every disk.
  2. Find the disk by its size, because the disk number is what you need.
  3. Type select disk 1, replacing 1 with your disk number, and press Enter.
  4. Type detail disk to check the selected disk before you go on.
  5. Type clean and press Enter.
  6. 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

CommandWhat Microsoft says it does
cleanRemoves all partitions or volume formatting from the disk with focus
clean allSets 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 typeWhat clean overwrites
MBROnly the MBR partitioning information and hidden sector information
GPTThe 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.

CommandWhat Microsoft says it does
Clear-Disk -Number 1Clears disk 1 only if it has no data or OEM partitions
Clear-Disk -Number 1 -RemoveDataClears the disk if it has data partitions, but not if it also has OEM partitions
Clear-Disk -Number 1 -RemoveData -RemoveOEMClears 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

ProblemWhat to check
Nothing happens or an error appearsMake sure a disk is selected, because Microsoft says clean fails without one
Access is deniedOpen the window as administrator
You cannot clear a disk in PowerShellAdd -RemoveData, and add -RemoveOEM if it has OEM recovery partitions
Wrong disk selectedRun list disk again and select the right number before you clean

Official sources

Leave a Reply

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