How to Delete hiberfil.sys in Windows PC
In this article
Hiberfil.sys is a hidden system file that Windows uses to store the contents of your RAM when your PC enters hibernation or fast startup. It can consume several gigabytes of disk space, which is often valuable on smaller SSDs. This guide explains how to safely delete or shrink hiberfil.sys by disabling hibernation and fast startup, and how to re-enable it if needed. You will need administrator access to your Windows PC.
What You'll Need
- Administrator account on the Windows PC
- Basic comfort using Command Prompt or PowerShell
Step-by-Step
- Close all open applications and save your work. Disabling hibernation will not restart your PC, but it is a good practice to avoid data loss.
- Open Command Prompt as Administrator. Click the Start button, type
cmd, right-click on “Command Prompt” and select “Run as administrator.” If prompted by User Account Control, click “Yes.” - Disable hibernation. In the Command Prompt window, type the following command and press Enter:
powercfg /h off
This command disables hibernation and automatically deletes the hiberfil.sys file from the root of your system drive (usually C:\). - Verify the file is gone. Open File Explorer, navigate to
C:\, and check that hiberfil.sys is no longer present. If you don’t see it, it may be hidden. To show hidden system files, go to the View tab in File Explorer, check “Hidden items,” and uncheck “Hide protected operating system files” (you may need to confirm a warning). The file should be absent. - Re-enable hibernation if desired. If you want to use hibernation again later, open Command Prompt as Administrator and type:
powercfg /h on
This recreates hiberfil.sys, but it may be smaller than before if you also adjust the hibernation file size (see Tips).
Common Mistakes
- Deleting the file manually. Trying to delete hiberfil.sys with File Explorer or by dragging it to the Recycle Bin will fail because the file is protected. You must use the
powercfgcommand. - Disabling only Fast Startup. Turning off Fast Startup in Control Panel does not delete hiberfil.sys. You must disable hibernation entirely to remove the file.
- Forgetting to run as Administrator. If the Command Prompt is not run as administrator, you will get an “Access denied” error. Always right-click and select “Run as administrator.”
- Assuming hibernation is the only feature affected. Disabling hibernation also disables Fast Startup, which may make Windows boot slightly slower. This is a trade-off for the disk space gained.
Tips
- Shrink instead of delete. If you want to keep hibernation but reduce the file size, run
powercfg /h /type reducedafter enabling hibernation. This creates a smaller hiberfil.sys (about 40% of RAM) that supports Fast Startup but not full hibernation. - Check disk space before and after. Note the free space on your system drive before and after disabling hibernation to see exactly how much space you reclaimed.
- Use Disk Cleanup as an alternative. If you prefer a GUI, you can run Disk Cleanup, select “Clean up system files,” and check “Hibernation File Cleaner.” This also removes hiberfil.sys without using commands.
- Remember that hibernation is useful on laptops. If you use a laptop, disabling hibernation means you cannot use the “Hibernate” power option. Consider whether you need that feature before removing the file.
Troubleshooting
- “Access denied” error. This almost always means you did not run Command Prompt as administrator. Close the window, right-click on Command Prompt, and select “Run as administrator.”
- hiberfil.sys still exists after the command. If the file does not disappear, try restarting your PC and then checking again. If it persists, ensure you are running the command in an elevated prompt and that you are on the correct drive (the system drive).
- Fast Startup is still enabled. After disabling hibernation, Fast Startup should be automatically disabled. If it still appears in Control Panel, restart your PC and check again. If it remains, you may need to disable it manually in Power Options.
- Hibernation option missing from Start menu. If you disable hibernation, the Hibernate option disappears from the Power menu. To bring it back, run
powercfg /h onand then go to Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable, and check “Hibernate.”
Frequently Asked Questions
Is it safe to delete hiberfil.sys?
Yes, it is safe if you disable hibernation using the powercfg /h off command. The file is only needed for hibernation and Fast Startup; Windows will recreate it if you re-enable those features.
Why is hiberfil.sys so large?
By default, hiberfil.sys is about 40% to 75% of your RAM size, depending on your system and settings. For example, a PC with 16 GB of RAM may have a hiberfil.sys of 6-12 GB.
Will deleting hiberfil.sys affect my files or programs?
No. Deleting hiberfil.sys does not affect your personal files, installed programs, or any data. It only removes the file used for hibernation and Fast Startup.
Can I delete hiberfil.sys manually?
No, you cannot delete it manually because it is a protected system file. You must use the powercfg command or Disk Cleanup to remove it.
How do I re-create hiberfil.sys after deleting it?
Open Command Prompt as Administrator and run powercfg /h on. This will recreate the file and enable hibernation and Fast Startup again.
Does disabling hibernation affect sleep mode?
No, sleep mode (Standby) is different from hibernation. Disabling hibernation does not affect normal sleep mode, which keeps your PC in a low-power state with RAM still powered.