Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Format USB Using CMD: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Formatting a USB drive using Command Prompt (CMD) on Windows is a quick way to wipe the drive and change its file system (like FAT32, NTFS, or exFAT) when the standard right-click Format option fails or you need a specific format. This method uses the built-in diskpart tool or the format command. You'll need a Windows PC and the USB drive you want to format—back up any important files first because formatting erases everything.

What You'll Need

  • A Windows computer (Windows 10 or 11 recommended; steps work on older versions too).
  • The USB drive you want to format.
  • Administrator access to open Command Prompt (right-click and select "Run as administrator").

Step-by-Step

  1. Insert the USB drive into a USB port on your computer. Make sure it's recognized—you can check in File Explorer (This PC) to see the drive letter (e.g., E:, F:).
  2. Back up any data you need from the USB drive. Formatting will permanently erase all files.
  3. Open Command Prompt as administrator: Click the Start button, type cmd or Command Prompt, right-click the result, and select "Run as administrator." If prompted by User Account Control, click "Yes."
  4. Start the diskpart tool: In the Command Prompt window, type diskpart and press Enter. This launches the disk partitioning utility.
  5. List all disks: Type list disk and press Enter. You'll see a table of disks (Disk 0, Disk 1, etc.) with sizes. Identify your USB drive by its size (e.g., 14 GB for a 16 GB drive). Be careful—selecting the wrong disk can erase your hard drive.
  6. Select the USB drive: Type select disk X (replace X with the disk number of your USB drive, e.g., select disk 1) and press Enter. The message "Disk X is now the selected disk" confirms it.
  7. Clean the drive: Type clean and press Enter. This removes all partitions and data from the selected disk. Wait for the message "DiskPart succeeded in cleaning the disk."
  8. Create a primary partition: Type create partition primary and press Enter. This creates a single partition on the drive.
  9. Select the new partition: Type select partition 1 and press Enter.
  10. Make the partition active (optional, only if you want the USB to be bootable): Type active and press Enter. Skip this if you're just formatting a regular storage drive.
  11. Format the partition: Type format fs=ntfs quick (or replace ntfs with fat32 or exfat) and press Enter. The quick flag speeds up the process. For a full format (slower but more thorough), omit quick. Wait for the "DiskPart successfully formatted the volume" message.
  12. Assign a drive letter: Type assign and press Enter. This gives the drive a letter (like E:). You'll see "DiskPart successfully assigned the drive letter or mount point."
  13. Exit diskpart: Type exit and press Enter. Then close the Command Prompt window.
  14. Verify the format: Open File Explorer and check that the USB drive appears with the new file system and is empty.

Alternative method using the format command (if you don't want to use diskpart): In Command Prompt, type format E: /fs:ntfs /q (replace E: with your drive letter, and ntfs with fat32 or exfat if needed). This formats the drive directly, but it doesn't remove existing partitions. Use this only if the drive is already partitioned and you just want to wipe the file system.

Common Mistakes

  • Selecting the wrong disk in diskpart—this can wipe your main hard drive. Always double-check the disk number and size.
  • Forgetting to back up data—formatting erases everything permanently.
  • Using the wrong file system—FAT32 is best for compatibility with older devices and has a 4 GB file size limit; NTFS supports large files but may not work on some TVs or game consoles; exFAT is a good middle ground for large files and modern devices.
  • Not running as administrator—diskpart and format commands require elevated privileges. If you get "Access denied," close and reopen CMD as admin.
  • Typing the drive letter incorrectly in the format command—double-check the letter in File Explorer.

Tips

  • Use quick format to save time; a full format checks for bad sectors but takes much longer.
  • If you need the USB to be bootable (e.g., for installing Windows), use format fs=ntfs (or FAT32 for UEFI) and make the partition active.
  • For a USB drive larger than 32 GB, Windows won't let you format as FAT32 via the right-click menu, but CMD will—just use format fs=fat32 (note: it may be slow).
  • Always eject the USB safely after formatting (right-click the drive in File Explorer and select "Eject") to avoid corruption.

Troubleshooting

If the format fails or the drive isn't recognized:

  1. Check the drive letter—run list volume in diskpart to see all volumes and their letters. Make sure you're using the correct one.
  2. Try a different USB port—sometimes a faulty port causes issues. Use a rear port on a desktop or a different port on a laptop.
  3. Run diskpart again—if you get "Access denied" or "The disk is write-protected," check if the USB has a physical write-protect switch (some have a small slider). If it does, move it to the unlocked position.
  4. Use the clean command again—if the drive still has partitions, repeat the diskpart steps from step 6 onward.
  5. If the drive still doesn't work, it may be physically damaged. Try it on another computer. If it fails there, the drive is likely dead and needs replacement.
  6. If you get "The volume is in use"—close any programs (like File Explorer windows) that might be using the drive, then retry.

Frequently Asked Questions

Will formatting a USB drive using CMD make it bootable?

No, formatting alone doesn't make it bootable. You need to create a bootable USB using tools like Rufus or Windows Media Creation Tool, or manually copy boot files after formatting.

Can I format a USB drive to FAT32 if it's larger than 32 GB?

Yes, using CMD with format fs=fat32 works on larger drives, though it may take a while. The Windows right-click format doesn't offer FAT32 for drives over 32 GB, but CMD does.

What's the difference between quick and full format?

Quick format just removes the file system and marks the drive as empty, while full format also checks for bad sectors and takes longer. For most uses, quick format is fine.

Does formatting a USB drive damage it?

No, formatting is a normal operation and doesn't damage the drive. However, repeatedly formatting a drive can wear it out over time, but that's true of any read/write activity.

Can I recover data after formatting?

Yes, but only if you use data recovery software immediately after formatting and before writing new data. The more you use the drive, the harder recovery becomes. Quick format makes recovery easier than full format.

Why does my USB drive show as 0 bytes after formatting?

This usually means the partition wasn't created properly. Run diskpart again, use clean, then create partition primary, and format again. If it persists, the drive may be failing.