How to Use DiskPart to Format a Drive in Windows (2025 Guide)

How to Use DiskPart to Format a Drive in Windows (2025 Guide)
Published: 2025 • Windows Tips • Disk Management

How to Use DiskPart to Format a Drive in Windows (2025 Guide)

Want to format your USB drive, hard disk, or SD card using Windows commands? This guide shows you how to use DiskPart — the powerful built-in Windows tool — to clean, partition, and format any drive safely.

💡 What Is DiskPart?

DiskPart is a command-line utility in Windows that lets you manage disks, partitions, and volumes. It’s faster and more powerful than the graphical Disk Management tool, making it perfect for fixing corrupted or unrecognized drives.

⚠️ Important Warning

Formatting a drive erases all data permanently. Double-check the drive letter or number before executing any command. Once a drive is cleaned, recovery may not be possible.

🧰 Steps to Format a Drive Using DiskPart

Step 1: Open Command Prompt as Administrator

  1. Press Win + X → click Command Prompt (Admin) or Windows Terminal (Admin).
  2. Type diskpart and press Enter.

Step 2: List Available Disks

list disk

This command displays all connected storage drives. Identify your target drive by its size. Example:

Disk 0    Online    500 GB
Disk 1    Online     32 GB

Step 3: Select the Target Disk

select disk 1

Replace 1 with your actual disk number. You’ll see: “Disk 1 is now the selected disk.”

Step 4: Clean the Disk (Optional)

clean

This removes all partitions and data from the selected disk, preparing it for a fresh format.

Step 5: Create a New Partition

create partition primary

This creates a new primary partition to make the drive usable again.

Step 6: Format the Partition

format fs=exFAT quick

You can change exFAT to another file system like NTFS or FAT32. Use quick to speed up formatting. Without it, the process takes longer but checks for bad sectors.

Step 7: Assign a Drive Letter

assign letter=E

This makes your newly formatted drive appear in File Explorer under the letter E (you can choose any unused letter).

Step 8: Exit DiskPart

exit

Close the tool — your drive is now formatted and ready to use!

🧾 Example: Full DiskPart Command Summary

diskpart
list disk
select disk 1
clean
create partition primary
format fs=exFAT quick
assign letter=E
exit

🧿 File System Options

File SystemBest For
FAT32Older devices, small drives (max 32GB)
exFATCross-platform (Windows + macOS)
NTFSWindows-only, supports large files

🧩 Troubleshooting Tips

  • If DiskPart shows “Access is denied”, make sure you opened Command Prompt as Administrator.
  • If you see “Write-protected”, clear it first using attributes disk clear readonly.
  • For corrupted drives, try running chkdsk X: /f /r after formatting (replace X with your drive letter).
Tags: DiskPart, format drive, Windows 11, USB, partition tools

Now you know how to format any drive using DiskPart in Windows. It’s a fast, reliable, and advanced method to clean and prepare your drives. Share this post if it helped you fix your USB or hard disk!

Next Post Previous Post
No Comment
Add Comment
comment url