How to Securely Overwrite Free Disk Space in Windows 11 Using Cipher

When you delete a file in Windows 11 and empty the Recycle Bin, the underlying data blocks are not immediately erased from the physical storage medium. Instead, the Windows New Technology File System (NTFS) merely marks the clusters as unallocated in the Master File Table (MFT), indicating that the operating system may overwrite them when additional storage capacity is required. Until new data overwrites those exact sectors, forensic inspection software and commercially available undelete utilities can readily reconstruct confidential documents, financial spreadsheets, and personal credentials.

While third-party file shredders often require administrative installations and background services, Windows 11 contains a native, cryptographic command-line utility called cipher. Originally designed to manage NTFS Encrypting File System (EFS) permissions, the /w parameter transforms cipher into a multi-pass sanitisation tool that systematically overwrites unallocated disk space across any local volume without disturbing active files.

How the Cipher Overwrite Algorithm Operates

The cipher /w command performs a rigorous, three-pass data sanitisation cycle designed to defeat magnetic and solid-state data recovery attempts:

  • First Pass (Zeroes): Fills all unallocated cluster addresses across the volume with hexadecimal 0x00 (all zeroes).
  • Second Pass (Ones): Overwrites the same unallocated clusters with hexadecimal 0xFF (all ones).
  • Third Pass (Pseudo-Random Numbers): Overwrites the sectors with cryptographically generated random byte patterns.

Because the command exclusively targets storage clusters marked as unallocated, none of your existing documents, installed applications, or system files are modified or deleted.

Preparing Your System Before Sanitising Free Space

To maximise sanitisation thoroughness and prevent running processes from locking temporary clusters:

  1. Close all active applications, virtual machines, and background web browsers.
  2. Empty your Recycle Bin to ensure all pending deleted items transition into unallocated space.
  3. Connect your laptop to AC mains power, as three-pass disk sanitisation demands sustained processing and prevents sleep mode timeouts.

Running the Cipher Command Step-by-Step

Executing disk cluster sanitisation requires elevated administrative credentials:

  1. Click the Start button, type cmd or powershell, right-click the top result, and select Run as administrator.
  2. Identify the drive letter containing the unallocated space you wish to wipe (for instance, system drive C: or secondary storage drive D:).
  3. Enter the sanitisation command targeting the directory or root mount:
cipher /w:C:
  1. Press Enter to launch the process.

The console displays real-time progress indicators as each of the three sanitisation passes completes:

To remove as much data as possible, please close all other applications while
running CIPHER /W.
Writing 0x00
.......................................................................
Writing 0xFF
.......................................................................
Writing Random Numbers
.......................................................................

Depending on the storage capacity of your drive and the volume of free space, the sanitisation process may take between twenty minutes to several hours. Once finished, the command prompt returns to the root shell, leaving previous deleted files completely unrecoverable.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.