To format a USB using CMD, first make sure you have copied everything you need from the drive. If Windows can already open the USB as a normal drive letter, you can format that volume directly from Command Prompt. For example, after verifying that E: is your USB, the command format E: /FS:exFAT /Q creates an exFAT file system without deleting the disk's partition table. Replace E: with your verified USB drive letter; never copy an example letter without checking it.

Do not format yet if the USB suddenly shows RAW, asks to be formatted before you can access it, or contains files you still need. Formatting changes the source drive and can reduce recovery options. If the USB reports No Media, shows 0 bytes, or repeatedly disconnects, skip the commands and investigate the hardware instead.

In This Article
    1. Confirm the Drive and Back Up Your Files
    2. Choose a Compatible USB File System
    1. Method A: Format a Verified Existing Volume
    2. Method B: Rebuild the USB Partition Layout Only After Backup

Part 1. Check the USB Before Running Any Format Command

Command Prompt can format an existing volume, while DiskPart can manage volumes, partitions and entire disks. Your safest method depends on what Windows recognizes and whether the USB already has a working partition.

Confirm the Drive and Back Up Your Files

Step 1. Connect the USB directly to a working port. Open File Explorer > This PC and note the drive letter, capacity and volume name. Then open Disk Management from the Start menu to compare that capacity with the physical USB. Disconnect other removable drives if doing so helps prevent a mix-up.

Step 2. If the files are accessible, copy them to another healthy drive and open a few copies to confirm they work. Check any other partitions on the USB too; removing its partition layout affects all of them.

Step 3. Decide whether you are formatting an existing volume or rebuilding an entire disk. A recognized drive letter does not call for clean. If the USB is unreadable and the files matter, use data-protection options before formatting a USB drive rather than trying destructive commands.

What Windows Shows Safer Next Action
USB has a normal letter and opens correctly After backup, use the CMD format command in Part 2.
Volume exists, but File Explorer formatting fails Check Disk Management and the volume details; Part 3 explains DiskPart volume formatting.
Partition layout needs rebuilding and all data is disposable Only then consider the advanced whole-disk process in Part 3.
RAW or prompts to format, with important files still missing Stop writes and consider recovery first; skip formatting.
No Media, 0 B, or intermittent disconnection Do not run clean or format; check device detection or seek specialist help.

Choose a Compatible USB File System

The file system affects compatibility and maximum file size. exFAT is often practical for modern Windows and macOS computers sharing files larger than 4 GB. Use FAT32 if an older camera, console or other device specifically requires it; a FAT32 file cannot be 4 GB or larger. Choose NTFS for workflows centered on Windows that need its Windows-specific features. Not every older device can read exFAT or NTFS.

Format Good Fit Check Before Choosing
exFAT Large files shared between modern computers Some older TVs, cameras and embedded devices do not support it
FAT32 Older devices that specify FAT32 Individual files must be smaller than 4 GB; Windows format tools have additional volume-size limitations
NTFS Windows-first drives with larger files Write compatibility varies on other operating systems and appliances

For a dedicated walkthrough of the Windows-specific option, see how to format a USB drive to NTFS.

Part 2. Format an Existing USB Volume Using Command Prompt

Use this shorter approach when the USB already has a valid drive letter and you want to change its file system or remove its existing files. It formats the selected volume; you do not need to run DiskPart clean or recreate the partition.

Step 1. Check the drive letter again. In File Explorer, confirm the USB's size and name. For the example below, only proceed if your actual USB is E:. Do not run these commands against the Windows system drive.

Step 2. Open Command Prompt as administrator. Search for Command Prompt, select Run as administrator, and approve the Windows prompt. Close any files that are still open on the USB.

Step 3. Enter the command for one file system. To create an exFAT volume on the verified USB drive letter, enter:

format E: /FS:exFAT /Q /V:USBFILES

For an NTFS volume, replace exFAT with NTFS. FAT32 can also be specified, but Windows' built-in formatter may refuse FAT32 on larger volumes; the formatting method does not bypass that size restriction. The /Q flag requests a quick format, which changes file-system metadata; it is not secure erasure. Microsoft documents these parameters in its Windows format command reference.

Real Windows screenshot: The following Windows 10 Command Prompt capture shows a completed NTFS format of drive E:. It illustrates the alternative NTFS option mentioned above, not the exFAT quick-format command. Always replace the example drive letter with the one you verified.

windows 10 command prompt showing the completed ntfs format for drive e

Step 4. Read the prompt before confirming. Windows may ask for the current volume label or request confirmation. If the displayed target or label is not the USB you intended, cancel the operation. Do not guess when Windows reports that the volume is in use, inaccessible or write-protected.

Step 5. Check the result. Wait for Windows to report completion, then open the USB in File Explorer. Confirm its file system in Properties and proceed to the read/write test in Part 5. If the command fails, do not immediately try clean; check the symptom table in Part 4.

Part 3. Format a USB with DiskPart When Needed

DiskPart is more powerful than the standard format command. It can format a selected existing volume or change a disk's partition layout. Windows acts on whichever object currently has focus, so check the volume or disk details immediately before any operation that writes data.

Method A: Format a Verified Existing Volume

This method is for a healthy, recognized USB volume whose current files have already been backed up. It does not erase all partitions on the USB.

Step 1. Start DiskPart. Open an elevated Command Prompt and enter:

diskpart
diskpart-format-step1

Step 2. List available volumes. Run list volume. Match the intended USB by its letter, size, label and file-system information; compare it with Disk Management.

list volume

Step 3. Select only the verified USB volume. Replace N with its actual volume number. The value is an example placeholder, not a number to reuse from someone else's screenshot.

select volume N
detail volume

detail volume helps you cross-check the underlying disk. If you cannot unambiguously identify the USB volume, type exit and stop. The Microsoft volume-selection documentation explains how DiskPart focus works.

Step 4. Format the selected volume. Once backed up and confirmed, use one appropriate format, such as:

format fs=exfat label=USBFILES quick

Use fs=ntfs instead only when NTFS fits your devices. This is a DiskPart command, not the format E: syntax from Part 2. No clean command is required for an ordinary existing volume.

Step 5. Exit and verify. When DiskPart confirms the format succeeded, run exit and check the USB file system in File Explorer or Disk Management. If the format cannot proceed, use Part 4 rather than trying random disk commands.

Method B: Rebuild the USB Partition Layout Only After Backup

Advanced and destructive: Use this only if the USB's partition layout is incorrect, the USB has been positively identified, and every file and partition on it is disposable or safely backed up. DiskPart clean removes the selected disk's partition and volume-formatting information. It is not a routine USB formatting step, a guaranteed hardware repair, or a secure-wipe substitute. Microsoft distinguishes clean from clean all, which zeroes sectors.

Step 1. Identify the physical USB disk before selecting it. In DiskPart, run list disk and compare disk sizes with Disk Management. The next screenshot shows an older Windows interface; its disk numbers are historical examples, not instructions to select that disk.

list disk
fix-usb-no-media-3

Step 2. Select and inspect the intended disk. Replace N with the verified removable USB disk number, then use detail disk to inspect its properties and associated volumes. Unplug the USB and rerun list disk if you need to confirm which entry disappears. Never use the screenshot's disk number as your target.

select disk N
detail disk
fix-usb-no-media-4

Stop if the target shows No Media, 0 B, includes a system/boot volume, or does not clearly match your USB. Do not proceed on a guess. The official DiskPart detail disk command shows the selected disk's volumes.

Step 3. Remove and recreate the partition layout. Only after confirming the disk and completing all backups, type these commands one at a time, checking the response to each:

clean
create partition primary

Warning: clean discards the existing partition layout and can make remaining data harder to recover. Do not run clean all as a faster alternative; it is a different, substantially more destructive command. If clean fails, stop rather than trying more forceful options.

create-partition-primary

Step 4. Format the new partition. DiskPart normally shifts focus to the newly created partition. After verifying that focus, choose the file system you need. For a general-purpose USB compatible with supported modern devices, this is an exFAT example:

format fs=exfat quick label=USBFILES

Do not use an old screenshot as proof that an NTFS full-format command is the right choice for your USB. The file-system selection should follow Part 1.

Step 5. Assign a drive letter and exit. When the format completes, run:

assign
exit
assign-diskpart

These retained screenshots come from an older Windows build and illustrate DiskPart's general sequence; current Windows 11/10 windows may look different. If your command output differs in disk identity, size or status, stop and verify instead of following the pictures blindly.

Free Download
Free Download

Part 4. What If CMD Cannot Format the USB?

Repeatedly forcing a format is rarely the best next move. A formatting error may come from an active file handle, a write-protected device, a missing partition, or hardware failure. These cases need different responses.

Problem Likely Issue Next Safe Step
Windows was unable to complete the format Volume in use, file-system or media error Close open apps, check Disk Management and data needs, then retry only the appropriate volume method; see the USB format error guide.
The disk is write protected Hardware lock, policy or controller condition Check a physical lock or work-computer policy before using disk attributes commands; see write-protected USB guidance.
USB appears as RAW, and files are missing Damaged or unreadable file system Stop writes; do not run clean, format or CHKDSK before considering recovery.
No Media, 0 B, or repeated disconnection Possible controller, connector or other hardware failure Try another known-good port or computer for detection only; if still unstable, stop software-only attempts.
Volume has no drive letter Unassigned mount point Check Disk Management; adding a letter may be enough without formatting.
Previously bootable USB has unusual partitions Installer media altered the partition scheme Back up what matters first; consider whole-disk rebuilding only when all partitions can be discarded.

Important: Formatting a USB is not a dependable way to repair physically failing flash memory or securely erase sensitive data for resale. For the separate task of sanitizing a device, review secure USB erase considerations rather than assuming a quick format is sufficient.

Part 5. Confirm the USB Was Formatted Correctly

Windows reporting a successful format is only the first check. Make sure you can use the drive with the file system you intended.

  1. Check the file system: Open File Explorer, right-click the USB, and inspect Properties. Confirm it shows exFAT, NTFS or the compatible file system you selected.
  2. Check the reported size: Compare the volume capacity with the USB's expected size. Some difference between advertised decimal GB and Windows' reported capacity is normal; an unexpectedly tiny volume may indicate an incomplete partition layout.
  3. Test a copy: If you no longer need the old data, save a small non-sensitive test file to the USB, safely eject it, reconnect it, and reopen the file. If files are still being recovered, do not perform a write test on the source USB.
  4. Use the intended device: A file system that works in Windows may not work in an older camera, TV, car stereo or console. Test compatibility before moving your only copy of an important file.

If the drive repeatedly disconnects, reports errors during simple file copies or becomes read-only again, stop using it for important data. A successful format does not establish that failing flash hardware has been repaired.

Part 6. Recover Files from a USB Before or After an Accidental Format

If you formatted the wrong USB or Windows suddenly shows the drive as RAW, stop using it immediately. Do not save test files, recreate partitions or run repeated formatting attempts. Data may still be recoverable when a logical volume remains detectable and its contents have not been overwritten, but the result depends on the drive and loss scenario.

If the USB is stable enough to be recognized, Wondershare Recoverit USB recovery on Windows or macOS can scan for recoverable files, show previews for supported types and let you save selected results to another healthy drive. It does not repair a broken controller, recreate overwritten data, or guarantee recovery. If the USB shows no usable media or keeps dropping out, consider a professional service instead of repeated scans.

Step 1. Connect the original USB and launch Recoverit. Install the software on the computer, not the affected USB. Confirm that the USB appears as a scan source before continuing.

Step 2. Select the affected external device. Choose the USB in Recoverit's device list. The exact location of the external-drive entry can vary by product version; follow the current Recoverit guide if its layout differs from these original article screenshots.

computer-data-recovery

Step 3. Scan the USB and review the results. Keep the source connected during the scan. Look for the folders or file types you need; use preview where the format is supported, while remembering that a preview does not guarantee every byte is intact.

scanning-lost-photos

Step 4. Recover selected files to another device. Save recoverable files on your computer's healthy internal drive or a separate external disk. Open some recovered files to confirm they work before doing anything else to the original USB.

preview-recovered-photos

If your USB was formatted accidentally and you want to learn more about limits and recovery order, see recovery after formatting a flash drive.

video

Recent Videos from Recoverit

View More >
Free Download
Free Download

Conclusion

When your USB already has a normal drive letter and its files are backed up, the CMD format command is usually simpler than rebuilding partitions with DiskPart. Use list volume and detail volume when you need to inspect an existing volume. Reserve clean for a confirmed whole-disk reset after every partition's data has been protected. If the USB is RAW or contains files you still need, recover or back up the data before formatting it.

FAQ

  • What command formats a USB drive in Windows CMD?
    If the USB already has a verified drive letter, Windows supports format E: /FS:exFAT /Q for an exFAT quick format. Replace E: with the confirmed USB letter and back up its contents first. It changes the selected volume's file system and is not a secure wipe.
  • Is DiskPart clean the same as format?
    No. clean removes the selected disk's partition and volume-formatting information. format creates a file system for a selected volume or partition. Use clean only for an intentional whole-disk reset after confirming the correct disk and protecting all data.
  • Can I format a USB using CMD without losing files?
    Formatting does not preserve the files currently on the volume. Copy accessible files somewhere else first. If the USB is unreadable and the data matters, stop and assess recovery before running format, clean or partition-creation commands.
  • Which CMD format is better for files larger than 4 GB?
    exFAT and NTFS support files larger than 4 GB. exFAT is often more convenient for sharing among modern Windows and macOS computers; NTFS is more suited to Windows-first use. Choose the file system supported by the devices that will read the USB.
  • Why does DiskPart show No Media or 0 bytes for my USB?
    Windows may not be receiving usable storage capacity from the device, which can indicate a connection or flash-controller problem. Try another known-good port or computer for detection only. Do not run clean or format on a device that reports no usable media.
Share article:
Get Recoverit Get Recoverit