sodcalculator

10 Tech How-To

How to Permanently Wipe a Flash Drive on Windows

Guide 10-50691 · Updated · Step by step

This guide shows you how to permanently erase a USB flash drive on Windows so the data cannot be recovered with common software. You will learn the built-in Diskpart method, a manual overwrite technique, and how to verify the wipe. You only need your flash drive and a Windows PC.

What You’ll Need

  • A USB flash drive (the one you want to wipe)
  • A Windows PC (Windows 10 or 11 works for these steps)
  • Administrator access to the PC (you will need to approve a UAC prompt)
  • Backup of any files you want to keep – the wipe is permanent

Step-by-Step

Method 1: Using Diskpart (Built-in, Fast, but Not Overwriting)

This method removes all partitions and file system structures, making the drive appear empty. It does not overwrite the actual data, so advanced recovery tools could still find fragments.

  1. Insert the flash drive into a USB port on your Windows PC.
  2. Press Windows + R, type diskpart, and press Enter. Click Yes when the User Account Control prompt appears.
  3. In the Diskpart command window, type list disk and press Enter. Note the disk number of your flash drive (e.g., Disk 1). Be absolutely sure you have the right disk – the next step will erase it completely.
  4. Type select disk X (replace X with your flash drive’s number) and press Enter. Diskpart will confirm the selection.
  5. Type clean and press Enter. This removes all partitions and file system signatures from the drive.
  6. Type create partition primary and press Enter.
  7. Type format fs=fat32 quick (or ntfs if you need files over 4GB) and press Enter. Wait for the format to complete.
  8. Type assign and press Enter to give the drive a letter.
  9. Type exit to close Diskpart. Your drive is now wiped and ready to use.

Method 2: Overwrite with a Single Large File (More Secure)

This method overwrites the existing data with random or zero data, making recovery far more difficult. It takes longer but is more thorough.

  1. Open File Explorer and note the drive letter of your flash drive.
  2. Create a large file on your PC – for example, a 1GB file. You can use a command prompt: press Windows + R, type cmd, and press Enter. Then type fsutil file createnew C:\dummy.bin 1073741824 (1GB in bytes) and press Enter.
  3. Copy that file to the flash drive. Windows will overwrite the free space with the file’s content. Repeat the copy until the drive is full – you may need to delete the file and copy it again several times.
  4. After the drive is full, delete the dummy file and format the drive normally (right-click the drive in File Explorer, choose Format, select FAT32 or NTFS, and click Start).

Method 3: Using the Format Command with /P (Overwrites Every Sector)

This built-in command overwrites every sector with zeros, which is more secure than a normal format.

  1. Open an elevated Command Prompt: press Windows + R, type cmd, right-click Command Prompt, and select Run as administrator.
  2. Type format X: /P:2 (replace X with your flash drive letter) and press Enter. The /P:2 tells Windows to overwrite every sector twice with zeros.
  3. When prompted, press Enter to confirm, then wait for the format to finish. This can take a while depending on drive size and speed.

Common Mistakes

  • Selecting the wrong disk in Diskpart – this can erase your internal hard drive. Always double-check the disk number and size.
  • Using a quick format for sensitive data – a quick format only removes the file system pointers, not the data itself.
  • Assuming Diskpart’s clean is enough for highly sensitive data – it removes the partition table, but data remains on the physical sectors.
  • Forgetting to back up – once wiped, there is no undo.
  • Interrupting the format or overwrite process – this can leave the drive in an unusable state.

Tips

  • For truly sensitive data, use a dedicated data destruction tool that overwrites with multiple passes (e.g., DoD 5220.22-M). However, for most personal data, a single overwrite with zeros is sufficient.
  • If your flash drive is very old or has bad sectors, the overwrite may fail. Consider physically destroying the drive if it contains irreplaceable data.
  • After wiping, check the drive in Disk Management to confirm it shows as unallocated or formatted correctly.
  • Use FAT32 for maximum compatibility with devices like TVs and game consoles, but NTFS if you need to store files larger than 4GB.

Troubleshooting

Diskpart says “Access Denied” or “The disk is write-protected”

Your flash drive may have a physical write-protect switch on the side. Slide it to the unlocked position. If there is no switch, the drive may be failing – try a different USB port or computer.

The drive does not appear in Diskpart

Check that it is properly inserted. Try a different USB port. If it still doesn’t show, open Device Manager, find the drive under Disk drives, right-click and select Uninstall device, then unplug and replug the drive.

The format fails with “Windows was unable to complete the format”

This often means the drive has bad sectors. Try using Diskpart’s clean first, then format. If it still fails, the drive may be physically damaged and should be replaced.

The drive becomes RAW or shows 0 bytes after wiping

This usually means the partition was removed but not recreated. In Diskpart, after clean, type create partition primary, then format fs=fat32 quick, then assign.

Frequently Asked Questions

Does a normal format permanently erase data?

No. A normal format only removes the file system structure. The actual data remains on the drive until overwritten. Use the /P switch or a third-party tool for permanent erasure.

Can I recover data after using Diskpart clean?

Possibly, with specialized recovery software. Diskpart clean only removes the partition table, not the underlying data. To make recovery nearly impossible, overwrite the drive with zeros afterward.

How long does it take to overwrite a USB drive?

It depends on the drive’s speed and size. A 16GB drive might take 10-20 minutes with a single pass. Larger or slower drives can take over an hour.

Is it safe to wipe a flash drive that has bad sectors?

Overwriting may fail on bad sectors. If the drive has physical damage, the wipe may not complete. In that case, consider physically destroying the drive if data security is critical.

What is the most secure method to wipe a flash drive?

Using a tool that overwrites with multiple passes (e.g., 3 or 7 passes) is more secure than a single pass. However, for most personal data, a single overwrite with zeros is sufficient. For absolute certainty, physically destroy the drive.

Can I wipe a flash drive on a Mac and use it on Windows?

Yes, but you need to format it with a Windows-compatible file system like FAT32 or exFAT. NTFS works for reading/writing on Windows, but macOS can only read NTFS by default.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →