When you delete a photo, video, or document on Android, the file isn’t instantly removed from the flash storage. The system simply marks the sectors as “available” and leaves the original bits untouched until they are overwritten by new data. For anyone with a forensic tool, those remnants can be recovered – a serious privacy risk if the deleted content contains personal or sensitive information.
Flash memory stores data in pages that are grouped into blocks. When a file is deleted, the file system (ext4, f2fs, etc.) clears the file‑table entry but does not erase the underlying pages. Because flash controllers use wear‑leveling, the “free” pages are later rewritten with new data, but until that happens the old bits remain readable with specialized tools.
Wiping free space forces the controller to write new data over every block that the file system considers free, effectively destroying any remnants. This is the same principle behind the shred command on Linux.
Several reputable apps can fill free space with random data without needing root access. The most popular are Secure Eraser and Data Eraser – Clean & Delete. Below we walk through Secure Eraser because it’s free on the Play Store and offers a clear “Wipe Free Space” option.
The app needs storage permission to create the temporary filler file. When prompted, tap Allow. On Android 11+ you may also need to enable “All files access” under Settings → Apps → Secure Eraser → Permissions.
Tap Start. The app will create a large temporary file filled with random bytes. Depending on the amount of free space, this can take anywhere from a few minutes to over an hour.
During the process you’ll see a progress bar and the amount of data written. Do not close the app or turn off the device until the bar reaches 100 %.
When the operation finishes, the app automatically deletes the temporary file. To verify, you can open Settings → Storage and confirm that the free‑space figure is the same as before the wipe (minus the small buffer you left).
If you prefer a command‑line approach or want to avoid installing third‑party apps, you can use adb to create a large filler file directly on the device. This method works on any Android version that supports ADB (Android 4.0+).
adb.adb devices
You should see a line with your device’s serial number and the word device./sdcard or /storage/emulated/0):
adb shell
cd /sdcard
df -h .
Note the “Available” column (e.g., 7.8G).wipe.tmp that uses most of the free space. The dd command writes raw bytes; we’ll use /dev/urandom for random data:
dd if=/dev/urandom of=wipe.tmp bs=1M count=7500
Explanation:
if=/dev/urandom – source of random bytes.of=wipe.tmp – destination file.bs=1M – block size of 1 MiB (makes the operation faster).count=7500 – number of blocks; adjust this value so the total size is a few hundred megabytes less than the free space you noted earlier.7500+0 records in when finished.
rm wipe.tmp
The deletion removes the directory entry, but the underlying flash pages stay filled with the random pattern written by dd.exit
adb disconnect
dd operation writes directly to flash and can cause noticeable wear on low‑end devices. Use it sparingly – a single full‑space wipe is usually sufficient for privacy.If you don’t have a computer handy, you can achieve the same result with a terminal app such as Termux. This method is handy for on‑the‑go wiping, but it still requires a bit of command‑line comfort.
termux-setup-storage the first time).pkg update && pkg upgrade
/data/data/com.termux/files/home/storage/shared):
cd ~/storage/shared
df -h .
count value to leave a small buffer):
dd if=/dev/urandom of=wipe.tmp bs=1M count=3000
rm wipe.tmp
dd: failed to open ‘/dev/urandom’: Permission denied, you may need to install the busybox package first: pkg install busybox.Before you ever delete a file, encrypt the storage partition. Modern Android devices already encrypt internal storage by default (since Android 6.0). However, if you have an older device that isn’t encrypted, you can enable full‑disk encryption via Settings → Security → Encrypt phone. Once encryption is active, any deleted file is already scrambled, making recovery far more difficult. After encryption, you can still run one of the free‑space wiping methods above for added confidence.
To be absolutely sure that remnants are gone, you can use a file‑recovery app such as DiskDigger (free version) or Undelete. These apps scan the raw storage for recognizable file signatures.
In most cases, after a successful free‑space overwrite you will see either zero results or only fragments that are too small to be useful.
count value in the dd command or use the app’s “Leave X MB free” option.Ctrl+C, delete the partially created file (rm wipe.tmp), and retry with a smaller size.Every write to NAND flash consumes a tiny amount of the cell’s endurance. A full‑space overwrite writes to every block once, which is comparable to a single heavy‑use day. For most users, doing this once every few months (or after deleting highly sensitive data) won’t noticeably shorten the device’s overall lifespan. If you have a device with a limited TBW (Terabytes Written) rating, you can schedule wipes only when you truly need them.
By following these steps you can confidently delete sensitive files, sell or recycle a device, or simply keep your personal data out of the hands of opportunistic forensic tools.
If you are preparing a phone for resale, donation, or disposal, a full factory reset (Settings → System → Reset → Factory data reset) combined with encryption offers the highest level of assurance. The reset wipes the entire partition table, and the encryption key is discarded, making any leftover bits practically meaningless. Use the free‑space wipe methods when you need a quick privacy boost without erasing your apps and settings.
Now you have a complete, reproducible method to securely erase free space on Android. Whether you prefer a one‑tap app, a command‑line ADB script, or a terminal‑emulator solution, the underlying principle is the same: force the flash controller to overwrite every block that the file system thinks is empty.









