hiberfil.sys: Delete the large file or use it to optimize the hibernation mode in Windows ([year])

Hiberfil sys custom resize via powercfg in Windows and optimize hibernation instructions by Sandro Villinger expert of Windows Tweaks

Was ist Hiberfil.sys – und warum ist die Datei so groß?

The hiberfil.sys is one of these very large Windows system files. Often several gigabytes in size, they usually become noticeable at some point:

The Windows PC is running slower than usual or the hard disk space is suddenly running out.

Or both.

Und dann entdeckt man diese versteckte Datei im Hauptverzeichnis von Windows (meist Laufwerk „C“, siehe Bild).

What does hiberfil.sys do and why do we need it?

The hiberfil.sys is the so-called Idle state file, die in in Windows 10/11/7 oft riesengroß ist und eine zentrale Rolle beim Ruhezustand deines PCs spielt (engl. „hibernation mode“). 

Ihr Name hiberfil leitet sich von „hibernate“ ab, auf Deutsch: Winterschlaf.

In Windows versions such as Windows 11, 10, 8 and 7, it saves the current status of your PC, including all open programs and documents.

Sie ermöglicht deinem Windows-Rechner, aus dem „Sleep-Mode“ to start up again more quickly and pick up right where you left off.

Hibernation could not work without this file.

But why is the Size of the hiberfil.sys file sometimes gigantic? 

Quite simply, it must be able to hold the entire contents of your working memory.

This means that the more memory your PC uses, the larger the file will be.

But in contrast to the Windows swap file speichert sie den Arbeitsspeicher-Inhalt nur für das schnelle Aufwachen aus dem Standby-„Schlafzustand“.

Hiberfil.sys löschen und Ruhezustand deaktivieren – ist das riskant? (Inkl. Anleitung)

Are you wondering whether deleting hiberfil.sys is a good idea? Because the file is very large and you want to speed up your Microsoft operating system or free up disk space?

We show you when it makes sense to remove the hibernation file and how to do it.

Can I delete the hiberfil.sys in Windows 10 / 11?

Yes, you can delete the hiberfil.sys, but there are a few things to keep in mind.

In the various Windows versions, such as Windows 10, 8 and 7, it is responsible for hibernation.

Wenn du diese Funktion nicht nutzt, kannst du die Datei löschen und so Speicherplatz freigeben – diesen Tipp even Microsoft itself.

But beware: standby hibernation mode no longer works without it.

Der Mittelweg: Willst du sie lieber verkleinern anstatt sie zu löschen? Dann springe zum Abschnitt weiter unten…

Anleitung zum Löschen der hiberfil.sys – so deaktivierst du den Ruhezustand

These 3 steps will show you how to securely delete hiberfil.sys in Windows 11 / 10 / 7 / XP:

  1. First open the command prompt with administrator rights. This is easy to do via the Start menu: Enter in the search field cmd ein, klicke mit der rechten Maustaste auf das Ergebnis und wähle „Als Administrator ausführen“ (oder klicke in Windows 11/10 direkt auf eingeblendeten Eintrag rechts, siehe Bild unten).
  2. Bestätige kurz das Öffnen mit Klick auf „Ja“.
  3. Then enter the command powercfg -h off and press Enter (alternatively the command powercfg.exe /hibernate off).

Voilà, the hiberfil.sys is deleted, your hibernation mode is deactivated and your hard disk space is happy.

You will no longer find the deleted file in Explorer, see screenshot below (only pagefile.sys and swapfile.sys are available).

Here are the picture instructions with the individual steps:

Video guide for deleting and deactivating hibernation mode

Advantages and disadvantages of deactivation

The advantage: If you deactivate hiberfil.sys, you will gain back disk space, as this file can often be several gigabytes in size.

The disadvantage? The standby mode of your Windows PC will no longer be available.

This means that you have to shut down your computer completely instead of quickly putting it into sleep mode and continuing to work seamlessly later.

Starting your PC without the hibernation file will therefore most likely take longer.

Restore deleted hiberfil.sys (activate hibernation mode)

If you want to use hibernation on your PC again, no problem!

We'll show you how to reactivate it so that you can enjoy the benefits of a quick start and seamless continuation of work.

Activating or reactivating sleep mode is just as easy as deactivating it:

  • Open the command prompt again as administrator. You do this by entering cmd im Startmenü, gefolgt von einem Rechtsklick auf das Suchergebnis und der Auswahl von „Als Administrator ausführen“.
  • Then enter the command powercfg -h on and confirm with Enter (works identically): powercfg.exe /hibernate on)

This activates the hibernation mode and the hiberfil.sys is needed again and created automatically.

How can I reduce the size of Hiberfil.sys? (2 methods)

Das Verkleinern der hiberfil.sys ist ein häufiges Anliegen der Nutzer – um Speicherplatz zu sparen, ohne dabei auf wichtige Funktionen wie den Ruhezustand verzichten zu müssen.

The good news: Microsoft has expanded the functions and from Windows 10 you can reduce the hiberfil.sys automatically or user-defined.

We show you how to effectively save hard disk space in Windows 11 and Windows 10 and reduce the size of the hibernation file without completely giving up your standby mode.

1. Automatically reduce the size of hiberfil.sys (Windows determines the size)

In Windows 10, you can automatically reduce the size of hiberfil.sys using the powercfg command.

This is done via a special command in the command prompt:

  • Open the command prompt as administrator and enter the command powercfg /h /type reduced.

Nach der Eingabe erscheint ein Text mit Bestätigung der jeweiligen Größe – in meinem Fall:

The size of the idle state file has been set to 1717874688 bytes.

This automatically reduces the size of hiberfil.sys according to system specifications, whereby the functionality of the idle state is largely retained.

But limited:

Reducing the size of the file may make hibernation a little slower, as less data can be saved in advance.

It is a compromise between storage space and speed.

2. customize the size of hiberfil.sys (you specify the size)

Would you like to customize the hiberfil.sys and set it to a size of your choice?

To do this, open the command prompt again with administrator rights and enter the following command:

Powercfg /h /size nn

Replace the Variable nn with a value between the Minimum value 40 and maximum value 100.

Use this command to activate the hibernation mode and set the size of the idle state file as a percentage of the installed memory.

Example: Here I have set my hibernation file to 80 percent:

Tip: Do not select a number that is too small, as otherwise the current memory content can no longer be inserted into the reduced hiberfil.sys.

Can I move the Hiberfil.sys?

Unfortunately it is not so easy to move the hiberfil.sys to another drive.

Windows deliberately stores this file on the system drive, as it is of central importance for hibernation.

An attempt to move them could lead to system instability or even loss of the idle state function.

We therefore advise against moving this file.

If you still want to try to free up space on your system drive, we recommend other methods: deleting unnecessary files or minimizing hiberfil.sys as described in the previous sections.

Differences of the hibernation file in Windows 11 / 10 / 7 / XP and before

Microsoft has optimized the handling of the hibernation file in Windows 10 and 11.

These newer versions offer improved setting options, such as quickly reducing the file size for hibernation via the command prompt.

Windows 11 and 10 are also more efficient in their use of disk space, which means that hiberfil.sys takes up less space on your hard drive.

In older versions of Windows, their management was less flexible.

Windows 8, Windows 7, Windows XP und Vista beispielsweise hatten nicht dieselben Befehlszeilenoptionen zur Optimierung der hiberfil.sys wie Windows 10 und 11 – das Verkleinern war noch nicht möglich.

And way back in Windows 2000 and ME, hibernation was a newer feature and therefore not managed as efficiently as in later versions.

Summary

  • Function: hiberfil.sys is a central system file that is responsible for the hibernation mode of your Windows PC. It saves the contents of your working memory to enable a quick wake-up.
  • Delete & deactivate sleep modeYou can deactivate or delete the hibernation file to save memory, especially if you are not using sleep mode. But keep in mind that sleep mode will no longer be available.
  • Reduce for disk space optimization: If you want to save disk space without giving up hibernation completely, you can reduce the size of hiberfil.sys in Windows 11 and 10.

FAQ

Source reference

  1. So deaktivieren Sie den Ruhezustand und aktivieren ihn erneut – Windows Client | Microsoft Learn
  2. Unterscheiden des schnellen Startvorgangs von „Wake-from-Hibernation“ – Windows drivers | Microsoft Learn
  3. Modern windows hibernation file analysis (lsu.edu)
  4. How to disable and re-enable hibernation – Windows Client | Microsoft Learn

By Sandro Villinger

Founded Windows Tweaks as a teenager in the 90s. His helpful PC tricks made it Germany's most visited Windows site (back then this is what Sandro looked like). He then went on to write elsewhere, such as for PC-Praxis, Computer Bild and PCWorld in the USA. Microsoft also poached him from us. Now Sandro is back, finally sharing his tweaks here again. For a stress-free digital everyday life. You can reach Sandro via e-mail.

2 comments

Leave a Reply to WIndows Tweaks Cancel reply

Your email address will not be published. Required fields are marked *