The format command is a Command Prompt command used to format a specified partition on a hard drive (internal or external), floppy disk, or flash drive to a specified file system.

Format Command Availability

The format command is available from within the Command Prompt in all Windows operating systems including Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, and older versions of Windows as well.

You can also format drives without using a command. See How to Format a Hard Drive in Windows for instructions.

However, it’s only useful from within Windows if you’re formatting a partition that can be shut down, or in other words, one that isn’t currently dealing with locked files (since you can’t format files that are in use). See How to Format C if that’s what you need to do.

Beginning in Windows Vista, the format command performs a basic write zero hard drive sanitization by assuming the /p:1 option. This isn’t the case in Windows XP and earlier versions of Windows.

The format command can also be found in the Command Prompt tool that’s available in Advanced Startup Options and System Recovery Options. It’s also a DOS command, available in most versions of MS-DOS.

If you’re using Command Prompt to format a drive from within Windows, you need to run an elevated Command Prompt to have the proper permissions.

See How to Wipe a Hard Drive for various ways to completely erase a hard drive, no matter what version of Windows you have. Most data destruction programs let you choose between several data sanitization methods to ensure that the files are securely overwritten and can’t be retrieved with data recovery programs.

Format Command Syntax

format drive: [/q] [/c] [/x] [/l] [/fs:file-system] [/r:revision] [/d] [/v:label] [/p:count] [/?]

The availability of certain format command switches and other format command syntax may differ from operating system to operating system. See How to Read Command Syntax if you’re not sure how to read the format command syntax as it’s described on this page.

There are some other less commonly used format command switches, too, like /A:size which lets you choose a custom allocation unit size, /F:size which specifies the size of the floppy disk that’s to be formatted, /T:tracks which specifies the number of tracks per disk side, and /N:sectors which specifies the number of sectors per track.

Format Command Examples

Here are some examples of how to use the format command:

You can output any results of the format command to a file using a redirection operator with the command. See How to Redirect Command Output to a File for help or check out Command Prompt Tricks for even more tips.

Quick Format

format e: /q /fs:exFAT

In the above example, the format command is used to quick format the e: drive to the exFAT file system.

format g: /q /fs:NTFS

Above is another example of the quick format command to format the g: drive to the NTFS file system.

To adopt this above example for yourself, switch out the letter e for whatever your drive’s letter is that needs formatted, and change exFAT to be whatever file system you want to format the drive to. Everything else written above should stay the exact same to perform the quick format.

Format and Write Zeros

format d: /fs:NTFS /v:Media /p:2

In this example, the d: drive will have zeros written to every sector on the drive twice (because of the “2” after the “/p” switch) during the format, the file system will be set to NTFS, and the volume will be named Media.

Format to Same File System

format d:

Using the format command without switches, specifying only the drive to be formatted, will format the drive to the same file system it detects on the drive. For example, if it was NTFS before the format, it will remain NTFS.

In MS-DOS, the format command is often used after using the fdisk command.

If the drive is partitioned but not already formatted, the format command will fail and force you to try again, this time specifying a file system with the /fs switch.

Considering how easy formatting is from within Windows, the command isn’t often used in the Command Prompt in Windows.

Formatting a hard drive is unnecessary if you want to delete just a few files. The del command exists to remove select files from the command line.

Get the Latest Tech News Delivered Every Day

  • Vol Command Examples and Options

  • What Is a Sector?

  • Copy Command

  • How to Format an SD Card on Windows

  • 35 Best Free Data Destruction Software Programs

  • Net Send Command

  • How to Use the Format Command to Write Zeros to a Hard Drive

  • 11 Best Free Disk Partition Software Tools

  • How to use a System Repair Disc to Format the C Drive

  • AOMEI Partition Assistant Standard Edition v9.13.1

  • Xcopy Command

  • MiniTool Partition Wizard Free v12.7

  • More Command

  • Fixboot Command (Recovery Console)

  • Sfc Command (System File Checker)

  • What Computer Formatting Means

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US