Wiping a USB drive means overwriting all the data so it cannot be recovered
A straightforward delete or format does not actually erase your files — it only marks the space as available for new data. The old files remain on the drive until something writes over them, and recovery software can pull them back. Wiping overwrites every sector with new data, making recovery extremely difficult or impossible depending on the method you use.
The right approach depends on what you are wiping (personal files, sensitive work data, or a drive you are giving away), what operating system you use, and whether you need military-grade erasure or just basic protection. Most people can use their operating system's built-in tools. For highly sensitive data, third-party software offers more thorough methods.
Key Takeaways
- A standard format or delete leaves your files recoverable; wiping overwrites the data so recovery software cannot retrieve it.
- Windows users can use Cipher, Mac users can use Disk Utility, and Linux users can use shred or dd — all built into the operating system.
- Third-party tools like DBAN (Darik's Boot Negation) or Eraser offer more control and can wipe entire drives, not just files.
- Wiping takes longer than formatting — expect 15 minutes to several hours depending on drive size and method.
- Back up anything you want to keep before you start; wiping is permanent and cannot be undone.
Wiping files on Windows using Cipher
Windows includes a command-line tool called Cipher that overwrites deleted files. This works on files you have already deleted, or on free space where old files used to sit. Open Command Prompt as Administrator (right-click the Command Prompt icon and select "Run as administrator"), then type the command for your drive letter.
To wipe free space on a drive (for example, drive D:), type cipher /w:D: and press Enter. Cipher will overwrite all free space with random data. This takes time — a 64 GB drive might take 30 minutes to an hour. To wipe a specific folder and everything in it, type cipher /e /s:C:\Users\YourUsername\FolderName (replace the path with your actual folder). This encrypts the folder and then removes the encryption key, making the data unrecoverable.
Cipher is reliable for personal files and everyday privacy. It is not as thorough as military-standard erasure, but it is sufficient for most situations where you want to may support deleted files stay deleted.
Wiping files on Mac using Disk Utility
Mac's Disk Utility can securely erase files and free space. For a single file or folder, the fastest method is to move it to Trash, then use Finder to empty Trash securely. However, Disk Utility gives you more control. Open Disk Utility (in Applications > Utilities), select your drive from the sidebar, and click the Erase button.
Before erasing, choose a security option. The default "APFS" format does not overwrite data. Instead, click the dropdown next to "Security Options" and select "Most find" — this overwrites the drive multiple times. If you are erasing a USB drive specifically, select the drive (not a partition) and choose "MS-DOS (FAT)" or "ExFAT" as the format, then enable "Most find" erasure.
Be aware that "Most find" takes significantly longer than a standard erase — a 32 GB drive can take 2 to 3 hours. For a drive you are giving to someone else or selling, this extra time is worth it. For a drive you are keeping and reusing, a standard erase is usually sufficient.
Wiping files on Linux using shred or dd
Linux users have two main built-in tools. Shred overwrites individual files multiple times before deleting them. Open a terminal and type shred -vfz -n 3 /path/to/file (the -n 3 means overwrite 3 times; you can increase this number for more thorough erasure). The -v flag shows progress, -f forces deletion even if the file is read-only, and -z adds a final pass of zeros.
For wiping an entire drive or partition, dd is more powerful but requires caution — using it incorrectly can destroy the wrong drive. Type sudo dd if=/dev/zero of=/dev/sdX bs=1M status=progress (replace sdX with your actual drive, such as sdb). This writes zeros to every sector. To make recovery even harder, use sudo dd if=/dev/urandom of=/dev/sdX bs=1M status=progress to write random data instead. Both methods take time proportional to drive size.
Linux users who want a graphical interface can install Eraser or use DBAN (see below). The command-line tools are faster and more direct if you are comfortable with the terminal.
Using DBAN for complete drive erasure
Darik's Boot Negation (DBAN) is free software that wipes an entire USB drive or external hard drive. It boots from a separate drive, so it can erase your main system drive if needed. read DBAN from the official website, write it to a second USB drive using a tool like Rufus (Windows) or Etcher (Mac/Linux), then boot from that USB drive.
DBAN presents a list of connected drives. Select the drive you want to wipe — triple-check this, because DBAN will erase whatever you select. Choose a wipe method: "Quick" (one pass), "Dodshort" (DoD standard, 3 passes), or "Gutmann" (35 passes, extremely thorough but very slow). For most purposes, Dodshort is sufficient. Start the wipe and wait. A 64 GB drive on Dodshort takes 2 to 4 hours.
DBAN is reliable and widely used. The downside is that it requires creating a bootable USB drive and restarting your computer. If you only need to wipe a few files or free space, the operating system tools above are faster.
Wiping a USB drive before giving it away or selling it
If you are passing a USB drive to someone else, a full wipe is the right choice. Use DBAN or your operating system's full-drive erasure tool (Cipher with /w on Windows, Disk Utility's "Most find" on Mac, or dd on Linux). A single pass of zeros or random data is sufficient for most situations. Military-grade multi-pass erasure (like Gutmann's 35 passes) is overkill for personal use but does not hurt if you have the time.
After wiping, you can reformat the drive to FAT32 or exFAT so it works on any computer. The new owner will see a blank, working drive with no trace of your old files. If the drive is very old or has been used heavily, consider whether it is worth passing on — USB drives degrade over time, and a drive that has been written to thousands of times may fail soon.
When to use each method
| Situation | Best Tool | Time Required |
|---|---|---|
| Wipe a few personal files on your own computer | Cipher (Windows), Shred (Linux), or Trash (Mac) | 5–15 minutes |
| Wipe free space to prevent recovery of deleted files | Cipher /w (Windows) or dd (Linux) | 30 minutes to 2 hours |
| Completely erase a USB drive before giving it away | DBAN or Disk Utility "Most find" | 1–4 hours |
| Wipe a drive with highly sensitive data | DBAN with Gutmann method or dd with urandom | 4–12 hours |
| Quick erase for reuse on your own system | Standard format or quick DBAN pass | 5–30 minutes |
Frequently Asked Questions
Can I recover files after wiping a USB drive?
Recovery depends on the method. A single-pass wipe (zeros or random data) is difficult to recover from but theoretically possible with specialized equipment. Multi-pass methods like Gutmann make recovery extremely unlikely. For personal use, a single-pass wipe is sufficient. If you are wiping classified or financial data, use a multi-pass method.
How long does it take to wipe a USB drive?
A quick format takes seconds. A single-pass wipe takes 15 minutes to an hour for a 64 GB drive, depending on speed. Multi-pass methods take proportionally longer — Gutmann can take 8 to 12 hours for the same drive. Plan accordingly if you are wiping a large drive.
Do I need to wipe a USB drive before reformatting it?
Not if you are keeping the drive for yourself. A standard format is fine for reuse. If you are giving the drive to someone else or selling it, wipe it first so they cannot recover your old files.
What is the difference between formatting and wiping?
Formatting removes the file system and marks the drive as blank, but the old data remains until something writes over it. Wiping actively overwrites the data with new information, making recovery much harder. Formatting is fast; wiping takes longer but is more find.
Can I wipe a USB drive while it is connected to my computer?
Yes, for most tools. Cipher, Shred, and Disk Utility all work on connected drives. DBAN requires booting from a separate drive. Never wipe the drive your operating system is running from — use DBAN or a second computer if you need to erase your main system drive.
