Home » Insider Builds » How to Format USB Drive using Command Prompt in Windows

How to Format USB Drive using Command Prompt in Windows

Cannot format USB drive from File Explorer? Here’s a simple way to format a USB drive from Command Prompt in simple steps.

To format a storage drive in Windows, you have to right-click on the drive and select the Format option. It’s a straightforward affair. No deep menus, no nothing. But, there will be times when this process fails to format the USB drive and throws bizarre errors. Some of these formatting errors include but are not limited to unable to format, unable to assign the drive letter, etc.

You can try formatting the USB drive from Command Prompt in those situations. Below are the steps needed to format a USB drive from Command Prompt. Follow them one by one, and you will have a formatted drive in a few seconds.

Warning: before formatting the USB drive, back up the date in it. Formatting a drive deletes all data, and the process is often irrecoverable.

The below method works in Windows XP, Vista, 7, 10, and 11.

Format USB Using CMD

Formatting a USB drive via Command Prompt is far easier than you think. All you have to do is select the drive and execute a specific format command.

  1. Plugin the USB drive.
  2. Open the Command Prompt as admin.
  3. Type “diskpart” and press “Enter” in the command window.
  4. Execute the “list disk” command.
  5. Find the USB disk number from the list.
  6. Execute the “select disk diskNumber” command where “diskNumber” is the actual disk number.
  7. Run the “clean” command after selecting the disk.
  8. Execute the “create partition primary” command to create a new partition.
  9. Run the “format fs=ntfs quick” command.
  10. Type and execute the “assign” command.
  11. Execute the “exit” command to exit the diskpart tool.
  12. Finally, close the Command Prompt window.
  13. With that, you are done formatting the USB drive from Command Prompt.

Steps with more details:

1. First, plug in the USB drive. After that, open the Command Promot window as admin. Search for cmd in the start menu, right-click on Command Prompt and select “Run as Administrator.”

2. To format the USB drive, we need to use the Diskpart tool. So, execute the diskpart command.

3. You will now be inside the Diskpart utility. Execute the list disk command to list all the disks in your system.

Format usb drive cmd list disk

4. From the list, identify your USB drive. You can generally identify the USB drive using its size. For instance, I’ve plugged in a 4GB pen drive. So my USB drive is represented as “Disk 2” with 3818MB.

5. After identifying the USB drive from the list of disks, type the below command and press Enter to execute the command. Replace <diskNumber> with the actual disk number.

select disk <diskNumber>

Once you replace the dummy command with the actual disk number, the command looks like this.

select disk 2
Format usb drive cmd select usb drive

6. After selecting the disk, you need to clean it. Execute the below command to clean the USB drive.


7. After cleaning the drive, it’s time to create the primary partition. For that, execute the below command

create partition primary

8. Now that the partition is created, we can format the drive. Execute the below command to format the USB drive with the NTFS file system. In general, Windows drives are formatted as NTFS. If you want a FAT32 file system, replace ntfs with fat32 in the below command. The “quick” part in the command is signaling the system to do a quick format. You will see it as a checkbox when you try to format drives from File Explorer.

format fs=ntfs quick
Format usb drive cmd format command

9. Even after formatting, you will not see the USB drive in the File Explorer. This is because Windows did not assign a drive letter to the newly formatted drive. You should tell Windows to assign a drive letter specifically. So, execute the below command to assign a drive letter to your USB drive.

Format usb drive cmd assign drive letter

10. That is it; you are done formatting the USB drive from Command Prompt. Remember, we are still in the Diskpart utility. To get out of it, execute the exit command.

Format usb drive cmd exit diskpart

11. After that, you can close the Command Prompt window by clicking the “X” button on the title bar or typing exit again.

12. If you open the File Explorer, you can see your drive formatted and neat.

Format usb drive cmd formatted

See? It’s not that hard to format a USB drive from Command Prompt. Comment below sharing your experiences or any problems you face while formatting a USB drive from Command Prompt.

You can also partition the USB drive to manage stored data better if you want.

If you like this article, check out how to zoom in and zoom out in command prompt and PowerShell and how to change command prompt or PowerShell cursor size, color, and shape.

4 thoughts on “How to Format USB Drive using Command Prompt in Windows”

Leave a Comment

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

Scroll to Top