How to Format a Hard Drive Using the Command Prompt

Formatting a hard drive or SSD is the same as buying a new hard drive since the process erases all the data in one fell swoop. When you format your hard drive, you can clean internal as well as external storage media.

In this tutorial, we explain how you can format a hard drive using the command prompt. Before proceeding further, make sure you backup all available data to prevent data loss. Follow the steps below to format a drive:

STEP 1:    Open Command Prompt As Administrator

Opening the command prompt.Opening the command prompt.

Search for command prompt, right click and run as Administrator.

STEP 2:    Use Diskpart

Using diskpartUsing diskpart

Once command line is open, type 'diskpart' and press Enter.

STEP 3:    Type List Disk

Using list diskUsing list disk

The above command will open a Diskpart window. In this window, type 'list disk' and press Enter. It will list all the available drives.

STEP 4:    Select the Drive to Format

Formatting a drive.Formatting a drive.

Now type 'select disk (disk number)' as shown above. Specify the drive number which needs to be formatted.

STEP 5:    Clean the Disk

Using the clean function.Using the clean function.

In this step, type 'clean'. This command will permanent delete all files and folders, and successfully clean up the disk.

STEP 6:    Create Partition Primary

Creating primary partition.Creating primary partition.

To make the drive again accessible, type 'create partition primary'.

STEP 7:    Format the Drive

Formatting a drive.Formatting a drive.

Now format the drive with FAT or NTFS file system. Type 'format fs=ntfs' and press Enter.

STEP 8:    Assign a Drive Letter

Assigning a drive letter.Assigning a drive letter.

To assign a drive letter, you can type 'assign' as shown below.

MORE: How to Enter the BIOS on Any PC

MORE: Windows How-To Articles

This thread is closed for comments
21 comments
    Your comment
  • ehmkec
    Am I missing something? Couldn't you just bring up a command prompt and type "format e:" - or some other drive letter?
  • tcaster6263
    would be kind of short for a tutorial don't you think?
  • polomint
    Or use Computer Management -> Disk Management if you want to remove all partitions on a drive then format it...