Pagefile.sys and Hiberfil.sys: Can You Delete Them?
A Safe Guide to Windows' Two Giant Hidden Files
Can you delete pagefile.sys and hiberfil.sys? The short answer: you can safely remove hiberfil.sys by running powercfg -h off in an administrator terminal, and Windows will delete the file instantly. Pagefile.sys, however, is Windows' virtual memory file and should not be deleted — leaving it system managed is the safe choice.
Together these two files often occupy well over 10-20 GB, and you cannot delete them like normal files because Windows keeps both locked while it is running. In this guide we'll explain what each file actually does, show the safe way to remove hiberfil.sys by disabling hibernation, explain why pagefile.sys deserves to stay, and walk through lower-risk ways to reclaim the same gigabytes of disk space.
What Are Pagefile.sys, Hiberfil.sys and Swapfile.sys?
So what is pagefile.sys exactly? It is Windows' virtual memory file, also called the paging file, and it lives in the root of your C: drive. When your RAM starts filling up, Windows moves less-used memory pages into this file so that applications keep running instead of crashing. It is also the channel through which Windows writes memory dumps after a system crash, which matters for diagnosing blue screens.
Hiberfil.sys is the hibernation file. When you hibernate your PC, the contents of your RAM are saved into this file so that every open window comes back exactly as you left it. The Fast Startup feature in Windows 10 and 11 also relies on it: at shutdown, Windows writes the system session into hiberfil.sys to make the next boot faster.
Swapfile.sys is the small sibling of the family: it is used to suspend and resume Microsoft Store (UWP) apps and typically takes up a few hundred megabytes at most. All three are hidden, protected operating system files. To see them, open Folder Options in File Explorer, switch to the View tab, untick 'Hide protected operating system files' and enable showing hidden items.
Why These Hidden System Files Are So Large
The size of both files is tied directly to how much RAM you have. Because hiberfil.sys has to store a copy of your memory, it usually ends up somewhere between 40 percent and the full size of your installed RAM — on a 16 GB machine that can mean more than 6 GB for this one file alone. Pagefile.sys, in its default system-managed mode, grows and shrinks with demand and commonly occupies several gigabytes.
Combined, the pair takes a noticeable bite out of a 256 GB SSD, which is why they are usually the first thing people spot when analyzing their disk. Windows does not keep them around arbitrarily: the paging file is a safety net against memory pressure, and the hibernation file enables both battery-saving hibernation and faster boots.
If you try to delete either file in File Explorer, you will get an access denied error, because Windows locks both while it is running. The correct approach is never to attack the files directly, but to turn off or resize the underlying feature using Windows' own tools, as described in the next sections.
How to Remove Hiberfil.sys by Disabling Hibernation
The only safe way to delete hiberfil.sys is to disable hibernation. Right-click the Start button and open Terminal (Admin) on Windows 11, or Windows PowerShell (Admin) on Windows 10. Then type powercfg -h off and press Enter; the command completes silently, and hiberfil.sys is removed immediately without a reboot.
This change has two costs: the Hibernate option disappears from the power menu, and Fast Startup is turned off, so cold boots may take slightly longer. On desktop PCs these features are rarely missed; if you use a laptop and rely on hibernation to preserve your session when the battery runs low, think twice. If you change your mind, powercfg -h on restores everything.
There is also a middle ground: running powercfg /h /type reduced in the same administrator terminal shrinks the file to roughly half its size while keeping Fast Startup — you only give up full hibernation. For laptop users who want to save space without losing quick boots, this is a sensible compromise.
Should You Resize or Disable Pagefile.sys?
Our short advice: do not disable pagefile.sys. Even with plenty of RAM, Windows and many applications expect a paging file to exist; without one, programs can fail with out-of-memory errors once RAM fills up, and Windows cannot write a memory dump after a crash, making problems harder to diagnose. The few gigabytes you would gain rarely justify those risks.
If you still want to inspect or adjust it: press Win+R, type sysdm.cpl and hit Enter, open the Advanced tab and click Settings under Performance, then switch to the Advanced tab in that window and click Change under Virtual memory. Unticking 'Automatically manage paging file size for all drives' lets you set a custom size or move the file to another drive; changes take effect after a restart.
If your system drive is genuinely cramped, setting a fixed, modest custom size or moving the paging file to a second drive is far safer than selecting 'No paging file'. Unless you have a specific reason, the right setting for most people is the default: system managed size.
Safer Ways to Reclaim Gigabytes of Disk Space
Before squeezing your virtual memory, look at the actual clutter: temporary files, browser caches, months-old downloads and a full recycle bin often add up to as much space as hiberfil.sys itself. Windows' built-in tools help here: Storage Sense under Settings, System, Storage can clean temporary files automatically, and the classic Disk Cleanup tool opens with the cleanmgr command.
Instead of doing each of those cleanups by hand, Disk Mop's Speed Up feature clears old downloads, system cache, browser cache and the recycle bin in a single click. Its Browser Cache Cleaner handles Chrome, Firefox and Edge individually, and the Downloads Cleaner categorizes the files in your Downloads folder so you can see at a glance what is safe to remove.
With Scheduled Cleanup you can set up weekly or monthly maintenance tasks so the clutter never builds back up to its old size. Regular small cleanups beat one heroic purge — and they keep your drive breathing without ever touching a system file.
Find What Is Really Eating Your Drive
Pagefile.sys and hiberfil.sys become targets because they are two big, visible files, but on most drives the real space is lost to forgotten videos, old installers, ISO images and duplicate photos. Hunting those down folder by folder in File Explorer can take hours.
Disk Mop's Disk Analysis scans your drive into a visual treemap that shows the largest folders at a glance. The Large File Finder lists every file over 500 MB, and the Duplicate Detector compares files with SHA-256 hashes, so identical photos, videos and documents are identified with certainty rather than guesswork — no risk of deleting a file that merely looks similar.
You can download Disk Mop for free with limited features; the Pro version is a one-time $9.90 payment for a lifetime license. Disabling hibernation saves you a few gigabytes exactly once — seeing what really fills your drive keeps paying off month after month.
Veredicto
To sum up: hiberfil.sys can be removed safely with powercfg -h off, at the cost of hibernation and Fast Startup. Pagefile.sys should not be deleted and is best left at its system-managed size, and swapfile.sys is too small to be worth touching. Before reaching for system files at all, it is always smarter to find out where your disk space is actually going.
That is exactly where Disk Mop fits in: Disk Analysis and the Large File Finder show what is really filling your drive, Speed Up clears old downloads, caches and the recycle bin in one click, and Scheduled Cleanup keeps the space you reclaimed from disappearing again. It is the easiest way to win back the same gigabytes without putting a single system file at risk.
Reclaim your disk space safely with Disk Mop
Pago único para acceso de por vida a todas las funciones. Sin suscripción, sin tarifas ocultas.
Descarga Disk Mop ahora