On most Windows PCs the hibernation file, hiberfil.sys, is removed by turning hibernation off from an administrator Command Prompt with the command powercfg /h off, which deletes the file automatically. You do not delete the file by hand, and you should not try to, because Windows keeps it locked while the system is running. The case where the method differs is a laptop you still want to sleep-with-resume: there you shrink the file with powercfg /h /type reduced instead of removing it.
What hiberfil.sys Is and Why Windows Keeps It
Hibernation writes everything in RAM to a hidden file named hiberfil.sys on your C: drive, then powers the machine fully off. On the next boot Windows reads the file back into memory and you continue where you left off, with no power drawn in the meantime. That is the difference from sleep, which keeps RAM alive using a trickle of battery power.
The file is sized at a large fraction of your installed RAM, so on a machine with 16 GB of memory it typically occupies roughly 12 GB of drive space. Windows sets this size itself, and it is hidden by default, so most people only notice it when their drive is nearly full and a disk-space tool shows a huge file they cannot delete.
Deleting hiberfil.sys with powercfg
These steps use the built-in Power Configuration tool. Menu labels can differ slightly between Windows versions, but the command itself has been the same for many years.
- Press the Start button, type cmd, right-click Command Prompt, and choose Run as administrator.
- Confirm the User Account Control prompt by clicking Yes.
- Type
powercfg /h offand press Enter. There is no output on success; the prompt simply returns. - Close the Command Prompt window.
- Open File Explorer, click This PC, and check that free space on the C: drive has increased by roughly the size the file used to occupy.
Turning hibernation off removes the file immediately and also removes the Hibernate option from the power menu. Fast Startup, which depends on a partial hibernation file, is disabled at the same time, so your PC will do a full shutdown from now on, which can add a few seconds to boot.
How to Tell the File Is Gone
The simplest check is free space: before running the command, note the ‘free space’ figure shown for the C: drive in This PC, then compare it afterwards. The increase should be in the same ballpark as the file size you saw in your disk-space tool.
If you want to see the file directly, open File Explorer, go to View and enable ‘Hidden items’, then open the C: drive root. hiberfil.sys should no longer be listed. You can also run powercfg /a in an administrator Command Prompt: the report will list the sleep states your hardware supports, and ‘Hibernate’ will either be absent or shown as not available, confirming the feature is off.
‘Access Is Denied’ When Deleting hiberfil.sys
The one failure almost everyone hits is trying to delete the file in File Explorer, which returns an access-denied or file-in-use error. The file is locked by the system and protected, so no amount of changing permissions on it is the right fix. The fix is to use powercfg /h off as above; that is the supported way, and it works even when the file shows as in use.
A second, rarer snag is running the command in a non-administrator prompt, which fails with a message that you do not have permission to perform the action. Close that window and reopen Command Prompt with ‘Run as administrator’ before trying again.
How Much Space You Get Back: Two Real Cases
On a desktop with 16 GB of RAM, hiberfil.sys typically takes about 12 GB, so turning hibernation off frees roughly 12 GB on a 256 GB drive, taking free space from, say, 40 GB to about 52 GB.
On a small laptop with 8 GB of RAM and a 128 GB drive, the file is typically about 6 GB. Removing it takes free space from around 18 GB to about 24 GB, which is a noticeable share of the drive. Exact sizes vary with how Windows configured the file, so treat these figures as typical rather than guaranteed, and check your own file size before deciding.
Keeping Hibernation but Making hiberfil.sys Smaller
If you hibernate a laptop, you do not have to give the feature up. The reduced option keeps hibernation available for the system while shrinking the file to roughly 40 percent of its full size, and it also keeps Fast Startup working. In an administrator Command Prompt, run powercfg /h /type reduced.
To undo it later and return to the full-size file, run powercfg /h /type full. If Windows reports that the reduced type is not supported on your hardware, the fallback is the choice between full hibernation and none at all.
Getting Hibernation Back After Removing the File
Removing hiberfil.sys is fully reversible. Open Command Prompt as administrator and run powercfg /h on; Windows recreates the file at its default size and the Hibernate option returns to the power menu. If the option does not appear in the menu after that, open Control Panel, go to Power Options, click ‘Choose what the power buttons do’, then ‘Change settings that are currently unavailable’, and tick ‘Hibernate’ under Shutdown settings.
Hibernation File Questions That Come Up With Small Drives
Does deleting hiberfil.sys affect my files or Windows updates?
No. The file holds only a snapshot of RAM from the last hibernation. Your documents, installed programs and Windows itself are untouched, and updates install as normal; you simply lose any hibernation session that was saved at the moment you turned the feature off.
Is it safe to remove hiberfil.sys on a laptop?
It is safe in the sense that nothing is damaged, but you lose hibernation, and on some laptops the manufacturer’s power plans expect it. If you rely on hibernate to survive a dead battery mid-work, use the reduced option instead of removing the file entirely.
Why does the file come back after I delete it?
Because hibernation itself is still enabled, and Windows rebuilds the file the next time the system hibernates or uses Fast Startup. Deleting the file never disables the feature; only powercfg /h off does, which is why hand-deleting is the wrong order of operations.
What about pagefile.sys sitting next to it?
pagefile.sys is the virtual-memory file, not the hibernation file, and removing it is a separate decision with different consequences. If your goal is only to reclaim the hibernation file’s space, leave the pagefile alone.