What a temp file is and why your computer creates them
A temporary file (or temp file) is a file your computer creates while you are working on something, then deletes when you close the program. Think of it like a notepad a cashier uses while ringing up your order — the information goes on the notepad, then gets thrown away once the receipt prints.
Your computer makes temp files for several reasons. When you edit a document in Microsoft Word, Word saves a temp copy while you work so it can recover your changes if the program crashes. When you read something, your browser creates a temp file to hold the read until it finishes. Video editing software, photo apps, and email programs all use temp files the same way — as a working space that gets cleaned up automatically.
Most of the time you never see these files. They live in hidden folders on your hard drive and disappear on their own. But sometimes you may need to find them — if a program crashed and you want to recover unsaved work, or if you are trying to free up disk space, or if a file got stuck and won't delete.
Key Takeaways
- Temp files are working copies that programs create and delete automatically; you usually do not need to open them yourself.
- On Windows, temp files are stored in C:\Users\[YourUsername]\AppData\Local\Temp, and on Mac they are in /var/folders or ~/Library/Caches.
- If you want to recover unsaved work from a crashed program, check the program's recovery folder first before looking in the system temp folder.
- Deleting temp files is safe and can free up disk space, but close all programs first to avoid deleting files a running program still needs.
Finding temp files on Windows
On a Windows computer, temp files live in a hidden folder. To see them, open File Explorer and type this path into the address bar at the top: C:\Users\[YourUsername]\AppData\Local\Temp. Replace [YourUsername] with your actual Windows username. Press Enter and the Temp folder will open.
You will see a lot of files and folders with names that look like random letters and numbers. These are the temp files your programs created. If you are looking for a specific file — say, a Word document you were editing when the program crashed — look for the most recent files (sort by date modified) and check the file size. A recovered document is usually larger than a tiny system temp file.
If the AppData folder does not show up, it means your view is set to hide system files. Go to the View tab in File Explorer, check the box for "Hidden items," and try again.
Finding temp files on Mac
On a Mac, temp files are scattered across two main locations. The first is /var/folders, which holds system-level temp files. The second is ~/Library/Caches, which holds app-specific temporary data. Both folders are hidden by default.
To see hidden folders on a Mac, open Finder and press Command + Shift + Period (the period key). This toggles hidden files on and off. Once hidden files are visible, you can navigate to either location by clicking the Finder menu, selecting "Go," and choosing "Go to Folder." Type the path and press Enter.
The /var/folders location contains many system files you should not touch. If you are looking for a specific document, the ~/Library/Caches folder is usually safer to browse, since it holds cached data from apps rather than critical system files.
Recovering unsaved work from a crashed program
If a program crashed and you lost unsaved work, the temp folder is not always your best option. Many programs have their own recovery features built in. When you reopen the program after a crash, it may show a recovery window automatically with a list of unsaved documents. Click the document you want and the program will restore it.
If the recovery window does not appear, check the program's menu. In Microsoft Word, go to File > Info > Manage Documents > Recover Unsaved Documents. In Google Docs, your work is saved automatically to the cloud, so you can straightforward log back in and find your document in your Drive. In Adobe Photoshop, go to File > Revert to see if a saved version exists.
Only if the program's own recovery does not work should you dig into the system temp folder. Even then, the file you find may be corrupted or incomplete, since it was interrupted mid-save.
Safely deleting temp files to free up space
Deleting temp files is safe as long as you close all programs first. Temp files are meant to be temporary — your computer expects them to disappear. However, if a program is still running and using a temp file, deleting it while the program is open can cause the program to crash or behave oddly.
To delete temp files safely on Windows, close all open programs, then open the Temp folder (C:\Users\[YourUsername]\AppData\Local\Temp). Select all files with Ctrl + A, then press Delete. Some files may refuse to delete if they are locked by the system — that is normal, just skip those.
On Mac, you can use the built-in Disk Utility to clear cache files, or manually delete files from ~/Library/Caches after closing all programs. Be cautious: deleting cache files may slow down apps slightly the next time you use them, since they will need to rebuild the cache.
A simpler alternative is to use your operating system's built-in cleanup tool. On Windows, run Disk Cleanup (search for it in the Start menu) and check the "Temporary files" box. On Mac, use Storage in System Settings to see what is taking up space and delete old files from the Downloads folder or Trash.
When you should not open or delete temp files
Do not open a temp file directly unless you are trying to recover unsaved work. Temp files are not meant to be edited — they are working copies, and any changes you make will be lost when the program closes or the file is deleted.
Do not delete temp files while programs are running. If you want to clean up, shut everything down first. Do not delete files from the /var/folders directory on Mac or from system temp locations on Windows unless you are certain what they are — some are critical to your operating system running smoothly.
If a temp file is stuck and will not delete, it usually means a program is still holding onto it. Restart your computer, then try deleting it again. If it still will not delete after a restart, leave it alone — it is taking up minimal space and will not harm your computer.
Frequently Asked Questions
Can I open a temp file in a regular program like Word or Notepad?
You can try, but it usually will not work well. Temp files are often in a format your regular programs do not recognize, or they are corrupted because they were interrupted mid-save. If you are trying to recover a document, use the program's built-in recovery feature instead — it knows how to read the temp file correctly.
Will deleting temp files speed up my computer?
Slightly, if your hard drive is very full. Temp files take up space, so removing them frees up storage. However, the real slowdown usually comes from having too many programs open at once or a hard drive that is nearly full. Deleting temp files is a good maintenance step, but it is not a magic fix for a slow computer.
Why does my computer keep creating temp files if they just get deleted?
Programs use temp files as a safety net. If the program crashes or your computer loses power, the temp file lets the program recover your work when you restart. It is the same reason a bank teller writes on a notepad — if something goes wrong, there is a record. Once the program closes normally, the temp file is no longer needed, so it gets deleted.
Is it safe to use a cleanup tool that deletes temp files automatically?
Yes, as long as you run it when no programs are open. Built-in tools like Windows Disk Cleanup and Mac Storage are safe because they are designed by the operating system makers. Third-party cleanup tools vary — some are legitimate, but others are aggressive and may delete files you actually need. Stick with your operating system's own tools unless you have a specific reason to use something else.
What if I cannot find the Temp folder even after unhiding system files?
On Windows, make sure you typed the path correctly and replaced [YourUsername] with your actual username. On Mac, try using Spotlight search (Command + Space) and typing "Library" to navigate there directly. If you still cannot find it, the folder may be in a different location depending on your system version — restarting your computer and trying again often helps.