# Can I Delete hiberfil.sys and pagefile.sys on Windows?

> What hiberfil.sys, pagefile.sys and swapfile.sys are for, why you cannot simply delete them, and the powercfg and Virtual memory settings that shrink or move them.

Canonical: https://bytesweep.app/answers/hiberfil-sys-pagefile-sys.html
Last updated: 2026-11-04

## Can I delete hiberfil.sys and pagefile.sys?

What hiberfil.sys, pagefile.sys and swapfile.sys are for, why you cannot simply delete them, and the powercfg and Virtual memory settings that shrink or move them.

- By [Shajeen Ahamed](https://bytesweep.app/about.html#author)
- Updated 4 November 2026
- Steps checked against Microsoft's documentation

**Short answer**

Not by deleting them; Windows has them open. You can remove hiberfil.sys by turning hibernation off with `powercfg /hibernate off`, which also turns off Fast startup, or shrink it with `/type reduced`. Leave pagefile.sys alone, or move it to another drive: Windows needs it for crash dumps and to extend memory.

### What are these files?

| File | What it is for | Size |
| --- | --- | --- |
| `C:\hiberfil.sys` | Holds the contents of memory when the PC hibernates, and the system state Fast startup uses to boot quicker | Grows with the amount of RAM: the more memory, the bigger the file |
| `C:\pagefile.sys` | The page file: memory pages Windows moves out of RAM, and the space a crash dump is written to | System-managed by default; it can grow when memory use runs high |
| `C:\swapfile.sys` | Used by Windows for apps from the Microsoft Store | Usually small; managed with the page file |

All three are hidden, protected system files. File Explorer shows them only with "Hide protected operating system files" unticked, and `dir C:\ /a` in a Command Prompt lists them with their sizes.

### How do I remove hiberfil.sys?

Turn hibernation off, and Windows deletes the file itself. In a Command Prompt or Terminal opened as administrator:

```
powercfg /hibernate off
```

The file disappears at once; no restart is needed. What you give up: the Hibernate option in the power menu, and **Fast startup**, which uses the same file. A PC with Fast startup off takes a little longer to start from a full shutdown. To turn both back on, run `powercfg /hibernate on`.

### Can I keep Fast startup and still save space?

Yes. A **reduced** hibernation file supports Fast startup but not full hibernation, and is smaller. Microsoft's [powercfg reference](https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options) gives the two commands, run in order as administrator:

```
powercfg /hibernate /size 0
powercfg /hibernate /type reduced
```

The first hands the size back to Windows; the second switches the type. A laptop you hibernate often should stay on the full type, or `powercfg /hibernate /type full` puts it back.

### Should I turn the page file off?

No, even with plenty of RAM. Microsoft's [introduction to the page file](https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/introduction-to-the-page-file) gives two reasons it is still needed on a large-memory PC: it backs the **system commit limit**, which is RAM plus all page files, and it supports**system crash dumps**. If programs ask for more memory than RAM alone can promise, they fail or freeze, and without a page file a blue screen leaves nothing behind to diagnose it.

A system-managed page file starts small and grows only when commit charge nears its limit; Microsoft puts the cap at three times the physical memory or 4 GB, whichever is larger, and no more than an eighth of the volume. So a large pagefile.sys usually means the PC really did run short of memory at some point. Task Manager, Performance, Memory shows "Committed" against its limit.

### How do I move the page file to another drive?

If C: is a small SSD and you have a second internal drive, you can move most of the page file there:

1. Press Windows-R, type `sysdm.cpl` and press Enter.
2. Open the Advanced tab, then Performance, Settings, then the Advanced tab again, and click **Change** under Virtual memory.
3. Untick **Automatically manage paging file size for all drives**.
4. Select the other drive, choose **System managed size** and click Set.
5. Select C:, choose a small custom size rather than No paging file, click Set, and restart.

Keeping a small page file on C: is deliberate: the crash dump settings expect one on the system drive. Do not move it to a USB or network drive.

### What else on C: is worth more than these files?

Hibernation and the page file are often the two biggest single files on a drive, which is why they get noticed, but they are rarely the reason the drive is full. Windows Update leftovers, Windows.old after an upgrade, restore points and app caches together usually come to more, and most of them can go with nothing lost. [Why the C drive is full](https://bytesweep.app/answers/why-is-my-c-drive-full.html) goes through them one by one, and [the WinSxS answer](https://bytesweep.app/answers/is-it-safe-to-delete-winsxs.html) covers the folder that looks largest of all.

Bytesweep for Windows measures those parts and explains each one, cleans the safe kinds with a 7-day undo (the Recycle Bin and DISM component cleanup excepted), and leaves the hibernation and page files to the Windows settings above. It is in the Microsoft Store, free to try for 3 days; cleaning needs a $29.99 licence, once per computer.

### Sources

Read on 4 November 2026. If something here has changed, write to [support@bytesweep.app](mailto:support@bytesweep.app) and it will be corrected.

- [Microsoft Learn, Powercfg command-line options](https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options)
- [Microsoft Learn, Introduction to the page file](https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/introduction-to-the-page-file)

### Keep reading

- [**Why is my C drive full, and what can I delete?**](https://bytesweep.app/answers/why-is-my-c-drive-full.html)
- [**Is it safe to delete the WinSxS folder?**](https://bytesweep.app/answers/is-it-safe-to-delete-winsxs.html)
- [**Bytesweep for Windows**](https://bytesweep.app/windows.html)
- [**All answers**](https://bytesweep.app/answers/)

### See what is filling your disk, and why.

Bytesweep is free to try for 3 days on [Mac](https://bytesweep.app/mac.html), [Windows](https://bytesweep.app/windows.html) and [Linux](https://bytesweep.app/linux.html). Cleaning needs a licence: $29.99 once per computer, no subscription.

[Download](https://bytesweep.app/download.html) [Pricing](https://bytesweep.app/pricing.html)
