TL;DR
This guide shows you how to completely erase all data from an SD card using your computer. This is useful before selling, recycling or reusing the card. We’ll cover methods for Windows, macOS and Linux.
Securely Wipe SD Card Data
- Understand the Risks
- Simply deleting files doesn’t remove them permanently. They can often be recovered.
- A full wipe overwrites all data on the card, making recovery much harder (though not impossible with advanced forensic techniques).
- Be absolutely sure you’ve backed up any important data before proceeding! This process is destructive.
- Connect your SD card to your computer using a card reader.
- Open Command Prompt as an administrator (search for ‘cmd’, right-click, and select ‘Run as administrator’).
- Type
diskpartand press Enter. - Type
list diskand press Enter. Identify your SD card number carefully! (Look at the size to be sure.) - Type
select disk X(replace ‘X’ with the correct disk number) and press Enter. Double-check you have selected the right disk! - Type
cleanand press Enter. This will erase the partition table. - Type
exitto leave Diskpart.
- Connect your SD card to your computer.
- Open Disk Utility (Applications > Utilities).
- Select your SD card in the left sidebar. Be careful to select the correct disk!
- Click ‘Erase’ at the top of the window.
- Choose a name for the SD card (optional).
- Set the Format to MS-DOS (FAT32) or ExFAT, depending on your needs.
- Crucially, click ‘Security Options…’ and select ‘7-Pass Erase’. This performs multiple overwrites. This will take a long time.
- Click ‘Erase’ again to confirm.
Warning: dd is powerful and can easily wipe the wrong disk if used incorrectly. Proceed with extreme caution.
- Connect your SD card to your computer.
- Identify your SD card device name (e.g., /dev/sdb). Use
lsblkin a terminal to list block devices and identify the correct one based on size. Be absolutely sure you have the right device! - Unmount the SD card if it’s mounted:
sudo umount /dev/sdb1(replace ‘/dev/sdb1’ with your actual partition).
- Run
ddto overwrite the entire disk. This example overwrites with zeros:sudo dd if=/dev/zero of=/dev/sdb bs=4M status=progress(replace ‘/dev/sdb’ with your SD card device name).
- Alternatively, use random data for a more secure wipe:
sudo dd if=/dev/urandom of=/dev/sdb bs=4M status=progress. This is slower but more thorough.
- After wiping, re-insert the SD card into your computer. It should appear as an unformatted drive.
- You can then format it normally for reuse.