Boot Restorer
Windows 10 & 11 Buy license · $39.95
Junk files

Is It Safe to Delete hiberfil.sys? How to Remove or Shrink It Properly

Is it safe to delete hiberfil.sys? Not by hand. Learn what the hibernation file does, how to turn it off or shrink it with powercfg, and what you give up.

Updated 5 minute read The Boot Restorer team

It is safe to get rid of hiberfil.sys, but not by deleting it in File Explorer. The file belongs to Windows' hibernation feature, it is locked while Windows runs, and Windows recreates it if hibernation is still turned on. The right way is to run powercfg /h off from an administrator terminal, which turns off hibernation and removes the file automatically. If you want to keep Fast Startup, run powercfg /h /type reduced instead to shrink the file. Either change can be undone at any time with powercfg /h on.

What hiberfil.sys does

When a PC hibernates, Windows writes the contents of memory to hiberfil.sys on the C drive, then powers off completely. When you turn it back on, Windows reads that file and you carry on where you left off, with your apps and documents still open. Unlike sleep, hibernation uses no power while the PC is off.

The same file is also used by Fast Startup, which is on by default in Windows 10 and 11. When you shut down, Windows saves part of the system state to hiberfil.sys so the next start is quicker.

Because it has to hold memory contents, the file is large: by default it is a big fraction of your installed RAM. On a PC with 16 GB of RAM it commonly takes several gigabytes, and more on machines with more memory.

How to see it and check its size

  1. Open File Explorer and go to the root of C (C:\).
  2. Click View > Show > Hidden items.
  3. If hiberfil.sys is not visible, you may also need to show protected operating system files: open View > Options, go to the View tab and untick Hide protected operating system files. Tick it again when you are done.
  4. Look at the size column for hiberfil.sys.

To see which sleep states your PC supports, run powercfg /a in a terminal. It lists whether hibernation and Fast Startup are available.

Why you cannot just delete it

If you try to delete hiberfil.sys in File Explorer, Windows says the file is in use. Even if you managed to remove it some other way, Windows would create it again at the next startup as long as hibernation is enabled. The file is controlled by a setting, so you change the setting.

Do not use file unlocking tools or boot into another system to delete hiberfil.sys. Changing the setting with powercfg is quicker, safe and reversible.

Option 1: Turn hibernation off completely

Best if you never use hibernate and do not mind slightly slower cold starts.

  1. Right-click Start and choose Terminal (Admin).
  2. Type powercfg /h off and press Enter.
  3. Check C:\ again. hiberfil.sys is gone and its space is free.

This also turns off Fast Startup, because it depends on the hibernation file. On a PC with an SSD, the difference in startup time is usually small.

Option 2: Shrink it and keep Fast Startup

Windows can use a reduced hibernation file that only supports Fast Startup, not full hibernation. It is much smaller than the full file.

  1. Open Terminal (Admin).
  2. Run powercfg /h /type reduced.
  3. If you see an error saying a custom size is set, run powercfg /h /size 0 first to return to the default size, then repeat step 2.

To go back to full hibernation later, run powercfg /h /type full.

A side effect worth knowing about

With Fast Startup on, choosing Shut down does not fully reset Windows; part of the system session is saved and reloaded. Restart always does a full restart. That is why some troubleshooting advice tells you to restart rather than shut down. If you dual boot with another operating system, Fast Startup can also leave your Windows drive in a locked state that the other system will not safely write to. For these setups, turning hibernation off is often the cleaner choice anyway.

Which option is right for you?

SettingCommandHibernateFast StartupDisk space
Full (default)powercfg /h /type fullYesYesLargest
Reducedpowercfg /h /type reducedNoYesSmaller
Offpowercfg /h offNoNoNone

Laptop users who close the lid and leave the machine for days may want to keep hibernation, because sleep slowly drains the battery while hibernation does not. Desktop users and people who always shut down fully can usually turn it off without noticing any difference.

What about pagefile.sys and swapfile.sys?

You will see these two files next to hiberfil.sys. They are not the same kind of thing and should be left alone:

  • pagefile.sys is virtual memory. Windows uses it when RAM is full and to record crash information. Removing it or making it too small can cause apps to crash with out-of-memory errors. Leave it on System managed size.
  • swapfile.sys is used by Store apps and is usually small. Leave it alone.

If the page file is very large, that usually reflects how much memory your PC needs, not wasted space.

Turning hibernation back on

If you change your mind, run powercfg /h on in an administrator terminal. Windows recreates hiberfil.sys and Fast Startup becomes available again. You can check it under Control Panel > Power Options > Choose what the power buttons do, where Turn on fast startup appears when the hibernation file is present.

If you are unsure whether you rely on hibernation, check your power settings under Control Panel > Power Options > Choose what the power buttons do. If none of the buttons or the lid are set to Hibernate and you never pick it from the Start menu, you are not using it.

Where else to find space

Turning off hibernation frees a useful few gigabytes, but it is a one-time gain. For more, look at restore points, update leftovers and, above all, your own files. See our guides to System Restore taking up too much space and what files you can safely delete from your C drive.

Drive Sweeper focuses on the space you can safely take back without changing system settings: duplicate files and photos, huge forgotten files, old downloads, temporary files and update leftovers. It never picks system files such as hiberfil.sys or pagefile.sys, labels everything safe, review or keep, and keeps removed files in a restore area for 30 days. On most well-used PCs, those categories add up to far more than the hibernation file, so Drive Sweeper is worth running before you start trading away Windows features.

Frequently asked questions

Will turning off hibernation disable Fast Startup?

Yes. Fast Startup uses the hibernation file, so turning hibernation off with powercfg /h off also turns Fast Startup off.

Is pagefile.sys safe to delete?

No. The page file is virtual memory that Windows uses when RAM is full. Leave it set to System managed size unless you have a specific reason to change it.

How big is hiberfil.sys?

It depends on your RAM. By default it is a large fraction of your installed memory, so on a PC with 16 GB of RAM it can take several gigabytes.

Get three guides like this every month, plus software update notices.Subscribe →