Skip to content

VersusSSD

SDelete vs cipher /w: Which Should You Use to Wipe Free Space in Windows?

Deleted files can often be recovered until their space is overwritten. We compare Microsoft's two free ways to wipe leftover data on Windows: the Sysinternals SDelete tool and the built-in cipher /w command. We cover what each can delete, how they clean free space, their options and why neither is the right way to sanitise an SSD.

By , Senior Hardware Editor

5 min read

SDelete vs cipher /w: Which Should You Use to Wipe Free Space in Windows?

Deleting a file in Windows doesn't erase its contents. The space is simply marked as free, and until something else is written there, recovery tools can often read it back. If you're about to sell or pass on a PC, or you just want old files to stay gone, there are two free Microsoft tools that overwrite that leftover data: SDelete from Sysinternals and the built-in cipher /w command. Both are run from the command line, but they're not interchangeable. This comparison is based on Microsoft's documentation as of 29 November 2026.

The short version

SDelete

cipher /w

Where it comes from

Free Sysinternals download (v2.06 at the time of writing)

Built into Windows

Deletes specific files securely

Yes

No

Wipes free space on a volume

Yes (-c)

Yes (/w:)

Zeroes free space

Yes (-z)

No dedicated option

Number of passes

Set with -p (default 1)

Not configurable

Supported Windows

Windows 10 and later, Windows Server 2012 and later

Windows' own command

What cipher /w does

cipher is mainly a tool for Windows' Encrypting File System (EFS): Microsoft describes it as a command that displays or alters the encryption of folders and files on NTFS volumes. Tucked into its options is /w, which Microsoft says removes data from available unused disk space on the entire volume.

You run it with a folder path, for example:

cipher /w:D:\

The folder can be anywhere on the volume, because the whole volume's free space gets wiped. Microsoft notes that if the path is a mount point or points to a folder on another volume, the data on that other volume is removed instead, so double-check the path before you press Enter. When you use /w, all other cipher parameters are ignored.

The appeal is that it's already on every Windows PC. You don't need to download anything, which makes it handy on a work machine or someone else's PC. The trade-off is control: there's no option to delete a particular file securely, no way to choose the number of passes and no zero-only mode.

What SDelete does

SDelete (Secure Delete) is a Sysinternals utility written by Mark Russinovich. Microsoft's page says you can use it both to securely delete existing files and to securely erase any file data left in the unallocated parts of a disk, including files you've already deleted or encrypted.

The main forms of the command are:

  • sdelete [-p passes] [-r] [-s] [-q] [-f] <file or directory> to securely delete files or folders. -s recurses into subfolders and -r removes the read-only attribute.

  • sdelete [-p passes] [-q] [-z|-c] <drive letter> to clean (-c) or zero (-z) free space on a drive, for example sdelete -c D:. Include the colon.

  • The same options also accept a physical disk number, but Microsoft notes that disks must not have any volumes on them to be cleaned that way.

-p sets the number of overwrite passes (the default is one). -z writes zeros, which Microsoft says is good for virtual disk optimisation, for example before compacting a virtual machine's disk file. SDelete also accepts wildcards in file and folder names.

Two details from Microsoft's documentation are worth knowing. First, SDelete securely deletes file data, but not file names that sit in free disk space. When you delete a file with SDelete, it renames the file 26 times to overwrite the name. Second, it handles NTFS compressed, encrypted and sparse files properly. NTFS writes new data for those files to new clusters, so simply overwriting the file wouldn't remove the old contents. SDelete uses the defragmentation API to find the exact clusters and overwrite them directly.

How they wipe free space

Both tools wipe free space by working with the file system rather than around it. Microsoft explains that SDelete doesn't overwrite free clusters directly, because that could collide with Windows writing new data at the same moment and corrupt files or file system structures. Instead it creates the largest file it can, overwrites it, then grabs any space that's left with a second file. On NTFS it also fills the free records in the Master File Table, where very small files can live, with files that it then overwrites.

Microsoft's cipher page doesn't describe how /w works internally, but for SDelete the practical upshot is that the drive temporarily fills right up, and it's sensible to treat cipher /w the same way. Close other apps, don't run a wipe on a drive that's busy recording or downloading, and expect it to take a while on a large, mostly empty drive. If you're short of space on C: afterwards, see how to free up disk space in Windows 11.

The big caveat: SSDs

Both tools were designed around how hard drives work, and neither Microsoft page discusses SSDs. Micron, which makes SSDs, says that overwriting data with an all-zero pattern is a perfectly legitimate method for a hard drive but is not an effective method for an SSD; the proper way to remove data from NAND flash is a block erase on the drive itself. In other words, free-space wiping from Windows isn't a reliable way to sanitise an SSD.

If you're selling or disposing of an SSD, use the drive maker's secure erase feature instead. Our guide to how to securely erase an SSD covers Samsung Magician, Crucial Storage Executive and the options built into Windows. For a hard drive, or a USB stick or memory card you're reusing yourself, SDelete or cipher /w is reasonable. Check the drive's health first with our guide to checking SSD and drive health if it's been acting up.

For files that need to stay private while you're still using the drive, encryption is a better approach than wiping after the fact. See VeraCrypt vs BitLocker.

Which should you use?

Choose cipher /w if you just want to clear free space on a hard drive or volume, you can't or don't want to download anything, and you don't need to target individual files.

Choose SDelete if you want to securely delete particular files or folders, need to choose the number of passes, or want to zero free space before compacting a virtual disk. It's part of the wider Sysinternals suite; see our pick of the best Sysinternals tools.

Choose neither if the goal is wiping a whole SSD before selling it. Use the manufacturer's secure erase instead, or reset Windows and clean the drive as described in our guide.

The bottom line

For a quick free-space wipe on a hard drive, the built-in cipher /w is fine, but SDelete is the more capable tool because it can also securely delete specific files, set the number of passes and zero free space. Neither is the right way to sanitise an SSD; use the drive maker's secure erase for that.

Sources

  1. 01Microsoft Learn (Sysinternals), SDelete v2.06
  2. 02Microsoft Learn, cipher
  3. 03Micron, The easy and fast way to securely remove all data from your SSD

About the author

Callum Reid

Senior Hardware Editor

Callum leads GPU, CPU and platform architecture coverage at Forge PC. Before joining the editorial desk, he spent nine years specifying, assembling and stress-testing custom gaming and workstation systems in the UK, with a focus on PCIe bandwidth, VRM thermal design, DDR5 memory tuning and 1440p/4K frame-time consistency.

More from Callum Reid

Read next

Best Free Emulators for PC in 2026

Best Picks

Best Free Emulators for PC in 2026

The best free emulators for PC in 2026: RetroArch for retro systems in one app, PCSX2 for PS2, Dolphin for GameCube and Wii, DuckStation for PS1 and PPSSPP for PSP. We compare the systems each covers, licences, BIOS needs, hardware requirements and features from each project's official site, and explain how to stay legal with your own games and BIOS dumps.

Hannah Vance6 min

How to Set Up PCSX2 on Windows: Play Your PS2 Games on PC

How-To

How to Set Up PCSX2 on Windows: Play Your PS2 Games on PC

PCSX2 can play much of the PlayStation 2 library on a Windows PC at higher resolutions than the original console. Using PCSX2's official documentation, we explain the hardware you need, how to install it, how to dump the BIOS from your own PS2 and your game discs, which renderer to choose, how to save safely and what to check if games run slowly.

Marcus Thorne8 min

Best Local AI Video Translation and Dubbing Tools in 2026

Best Picks

Best Local AI Video Translation and Dubbing Tools in 2026

Free AI tools can now transcribe a video, translate it and dub it into another language on your own PC. We pick the best: pyVideoTrans, VideoLingo, OpenCreator (formerly KrillinAI) and SoniTranslate, comparing offline use, languages, voices, setup, licences and hardware from each project's official docs.

Hannah Vance5 min

pyVideoTrans vs VideoLingo: Which Local AI Video Translator Should You Use?

Versus

pyVideoTrans vs VideoLingo: Which Local AI Video Translator Should You Use?

pyVideoTrans and VideoLingo are popular open-source tools for translating and dubbing videos with AI on your own PC. Using each project's official docs, we compare installation, speech recognition, translation engines, dubbing voices, offline use, GPU support and licences, and say which suits which job.

Callum Reid4 min