What hiberfil.sys is and why it takes up space

Hiberfil.sys is a hidden system file that Windows creates when you turn on hibernation mode. When your computer hibernates, Windows saves everything in your RAM (memory) to this file on your hard drive, then powers down completely. When you wake the computer, it reads from hiberfil.sys to restore your session exactly as you left it.

The file is roughly the same size as your computer's RAM. If you have 16 GB of RAM, hiberfil.sys takes up about 16 GB of disk space — even if you never use hibernation. For people with limited storage, especially on laptops with smaller drives, this is wasted space.

You cannot delete hiberfil.sys while Windows is running, and you should not try to force-delete it. The file is protected by Windows and deleting it improperly can cause system errors. The correct approach is to disable hibernation, which tells Windows to stop maintaining the file.

Key Takeaways

  • Hiberfil.sys is created by Windows to store your RAM contents when the computer hibernates, and it takes up disk space equal to your RAM size.
  • You cannot delete the file directly — you must disable hibernation through the command line or power settings, which removes the file automatically.
  • Disabling hibernation is safe if you use sleep mode instead, which uses far less power and wakes up faster than hibernation.
  • On Windows 10 and 11, the fastest method is running one command in Command Prompt as administrator, which takes about two minutes.

How to disable hibernation on Windows 10 and 11

The quickest way is through Command Prompt. Right-click the Start button, select "Command Prompt (Admin)" or "Windows PowerShell (Admin)" — the exact name depends on your Windows version. If you see "Terminal (Admin)" instead, that works too.

Type this command exactly and press Enter:

powercfg /h off

Windows will process the command silently. There is no confirmation message. Once the command finishes, hiberfil.sys is gone and your disk space is freed. You can close Command Prompt.

To verify it worked, open File Explorer, go to the C: drive (or whichever drive holds Windows), and check if hiberfil.sys is no longer there. You may need to enable viewing hidden files first: click the View tab at the top, then check "Hidden items".

How to disable hibernation through Settings

If you prefer not to use Command Prompt, you can disable hibernation through the graphical interface, though it takes a few more steps. Open Settings and search for "power plan" or "power settings".

Click "Change plan settings" next to your current power plan (usually "Balanced"). Then click "Change advanced power settings". A window will open with a tree of options. Scroll down to find "Sleep", expand it, then expand "Hibernate after". Set the value to "Never" for both "On battery" and "Plugged in".

Click explore, then OK. This disables hibernation, but does not when ready delete hiberfil.sys. To force deletion, you still need to run the Command Prompt command above. Alternatively, restart your computer — Windows will delete the file on the next startup.

The difference between hibernation and sleep mode

Hibernation and sleep are often confused because they sound similar. Sleep mode keeps your RAM powered and running, so your computer wakes when ready — usually in one to three seconds. Hibernation powers down almost everything, so it uses almost no electricity, but waking takes longer because Windows must read from the disk.

Most modern laptops default to sleep mode because it is faster and uses very little power anyway. Hibernation was more useful on older machines with poor battery life. If you use sleep mode and your battery drains completely, you lose your unsaved work — hibernation protects against that because the session is saved to disk.

If you regularly work offline for hours and want to preserve your session without draining the battery, hibernation is worth keeping. If you dock your laptop at a desk most of the time, or if you have a newer machine with good battery life, disabling hibernation and using sleep mode is the practical choice.

What happens if you disable hibernation by mistake

Disabling hibernation does not break anything. Your computer will work normally — it will just use sleep mode instead. If you change your mind, you can re-enable hibernation by running this command in Command Prompt as administrator:

powercfg /h on

Windows will recreate hiberfil.sys on the next shutdown or restart. There is no risk in trying it and changing back.

Why you should not manually delete hiberfil.sys

You might find guides online suggesting you delete hiberfil.sys through Safe Mode or by taking ownership of the file. Do not do this. The file is locked by Windows for a reason — deleting it while the system depends on it can cause boot failures, system crashes, or data loss.

The proper method — disabling hibernation through the command or settings — tells Windows to stop using the file and remove it safely. This takes two minutes and carries no risk. Manual deletion is faster in theory but can damage your system in practice.

How much disk space you will recover

The space freed equals your RAM size. If your computer has 8 GB of RAM, you recover 8 GB. If it has 32 GB, you recover 32 GB. You can check your RAM size by right-clicking "This PC" or "My Computer", selecting Properties, and looking for "Installed RAM".

For people with solid-state drives (SSDs) under 256 GB, this can be meaningful — the difference between having 20 GB free and 30 GB free. For people with larger drives or traditional hard drives, the benefit is smaller but still real.

Frequently Asked Questions

Will disabling hibernation slow down my computer?

No. Sleep mode is actually faster than hibernation — your computer wakes in seconds instead of tens of seconds. The only downside is that if your battery completely drains while in sleep mode, you lose unsaved work. Hibernation protects against that, but most people do not need that protection.

Can I delete hiberfil.sys on Windows 7 or older versions?

Yes, the same methods work. Use Command Prompt as administrator and run powercfg /h off. Windows 7 uses the same hibernation system as newer versions.

What if the command does not work or says access denied?

Make sure you opened Command Prompt as administrator — right-click it and select "Run as administrator". If you see "access denied" even then, another program may be controlling hibernation settings. Check your laptop manufacturer's power management software (Dell, HP, Lenovo, etc. often include their own tools). Disable hibernation there first, then try the command again.

Does disabling hibernation affect my ability to use sleep mode?

No. Sleep mode and hibernation are separate features. Disabling hibernation does not touch sleep mode — your computer will still sleep normally and wake quickly.

Is hiberfil.sys the only hidden file taking up space on my drive?

No. Windows also maintains pagefile.sys and other system files. Hiberfil.sys is usually the largest, but if you are looking to free more space, check your Downloads folder, temporary files, and old backups — those often hold more recoverable space than system files.