hiberfil.sys (hibernation file)
hiberfil.sys is a hidden system file in the root of the Windows drive (C:\hiberfil.sys). Windows writes the contents of memory into it when the PC hibernates, and Fast Startup uses it to save the Windows kernel at shutdown. Its size is a share of the installed RAM, so on PCs with a lot of memory it can take many gigabytes.
1What uses it
Hibernate saves the whole session to disk and turns the PC off; the session is restored from hiberfil.sys at the next start.
Fast Startup, which is on by default on many PCs, saves only the kernel session at shutdown, which makes the next start faster. It also needs the hibernation file.
2Size
powercfg /h /type reduced keeps a smaller file that is enough for Fast Startup but not for Hibernate. /type full restores the full size. /size sets the size as a percentage of memory.
3Turning hibernation off
powercfg /hibernate off deletes hiberfil.sys and turns off Hibernate and Fast Startup. powercfg /hibernate on creates the file again. The file must not be deleted by hand.
How to shrink or remove hiberfil.sys
- Open Command Prompt as administrator.
- To keep Fast Startup with a smaller file, run:
powercfg /h /type reduced - To remove the file completely, run:
powercfg /hibernate off - To turn it back on later, run:
powercfg /hibernate on
Cautions
- Without the hibernation file there is no Hibernate and no Fast Startup.
- On laptops, hibernation can protect the session when the battery runs out; think twice before turning it off.
- Never delete hiberfil.sys in File Explorer; use powercfg.
Related articles
- pagefile.sys (page file)What the Windows page file does, why it should not be removed, and how its size is managed.
- Temporary files in WindowsWhere Windows keeps temporary files (%TEMP%, C:\Windows\Temp), what is safe to delete and the supported ways to clean them.
- Storage SenseWhat Storage Sense does in Windows 10 and 11, which files it removes, and how to configure it safely.
Sources
- Disable and re-enable hibernation (Microsoft Learn) learn.microsoft.com
- Powercfg command-line options (Microsoft Learn) learn.microsoft.com
Last reviewed: