A TMP file is a temporary file your computer creates while a program is running, then deletes when you close it
When you open a document, edit a photo, or run almost any program, your computer needs a place to store information it's actively working on. A TMP file (short for temporary) is that holding space. It's not meant to stay on your hard drive — it's a working file that gets thrown away once you're done.
You'll find TMP files scattered across your computer in folders you probably never see. Windows stores them in a Temp folder buried in your user directory. Mac does the same in a hidden tmp folder. Most of the time, you don't need to think about them at all. They appear, do their job, and vanish on their own.
The problem starts when programs crash or don't shut down properly. When that happens, TMP files stick around instead of deleting themselves. Over time, thousands of orphaned temporary files can pile up and slow your computer down. That's when you might need to clean them out manually.
Key Takeaways
- TMP files are temporary working files that programs create and delete automatically when they close normally.
- Your computer stores TMP files in hidden system folders, so you won't see them during everyday use.
- When programs crash or freeze, their TMP files don't delete and can accumulate over months or years.
- Deleting old TMP files is safe and can free up disk space, but you should never delete TMP files from programs currently running.
Where TMP files live on your computer
On Windows, temporary files go into a folder at C:\Users\[Your Username]\AppData\Local\Temp. The AppData folder is hidden by default, so you won't stumble across it by accident. To see it, you need to turn on "Show hidden files" in your File Explorer settings.
On Mac, TMP files live in /var/tmp and /tmp, both of which are hidden folders. You can access them through Terminal or by using Finder's "Go to Folder" command, but most Mac users never need to look there.
Some programs also create their own temporary folders inside your Documents or Downloads directory. These are easier to spot because they're not hidden. You might see folders named something like "~temp" or "cache" — those are doing the same job as system TMP files, just in a place the program chose.
Why programs create temporary files in the first place
When you're working on a large file — a video, a spreadsheet with thousands of rows, or a photo with many layers — your computer can't hold all of that in memory at once. It needs to write pieces of it to disk temporarily so it can work on different parts. That's what a TMP file does.
TMP files also act as a safety net. If a program crashes while you're working, the TMP file might be recoverable. Some programs use it to store your recent changes so they can offer to recover your work when you restart. Word and Google Docs both do this — they save temporary copies of your document so you don't lose everything if the power goes out.
Another reason is speed. Reading and writing to disk is much faster than constantly shuffling data in and out of your computer's memory. By using a TMP file as a buffer, programs can work more smoothly without freezing up.
When TMP files don't delete and cause problems
Under normal circumstances, a program deletes its TMP files when it closes. But if the program crashes, freezes, or your computer loses power unexpectedly, those files get abandoned. They sit on your hard drive taking up space, and new ones keep piling up.
After months of use, you might have thousands of orphaned TMP files. They don't cause immediate problems, but they do consume disk space. If your hard drive is already full or nearly full, a buildup of TMP files can slow your computer down noticeably. Your system has to search through more files to find what it needs.
In rare cases, a corrupted TMP file can cause a program to behave strangely or crash on startup. If a program keeps crashing and you've already tried restarting it, clearing out old TMP files sometimes fixes the problem.
How to safely delete TMP files
The safest way to clean up TMP files is to use your operating system's built-in disk cleanup tool. On Windows, search for "Disk Cleanup" in the Start menu, run it, and check the box for "Temporary files." Windows will delete the ones it's safe to remove and leave alone anything a running program needs.
On Mac, you can use the Storage settings under System Preferences to see what's taking up space, though Mac is better at cleaning up after itself than Windows is. You can also download a third-party cleaning tool like CleanMyMac or AppCleaner, though the built-in tools are usually enough.
If you want to do it manually on Windows, open File Explorer, navigate to the Temp folder, and delete files that are several weeks or months old. Don't delete anything from today or yesterday — those might belong to programs you're currently using. On Mac, you can do the same in Terminal using the rm command, but this requires more technical knowledge.
Never delete TMP files while the programs that created them are still running. If you delete a TMP file that a program is actively using, you could cause that program to crash or lose unsaved work.
The difference between TMP files and other temporary files
TMP files are just one type of temporary file your computer creates. Cache files are similar but serve a different purpose — they store copies of things you've already downloaded or viewed so they load faster next time. Your browser cache, for example, stores web pages and images so websites don't have to download them again.
Temporary files can also have other extensions like .tmp, .temp, .bak (backup), or .swp (swap). They all work the same way: they're created during use and deleted when the program closes. Cleaning tools usually remove all of these at once.
The key difference is that cache files are often worth keeping because they speed things up, while TMP files are almost never worth keeping once they're old. Your browser might re-download a cached page if you clear it, but deleting a TMP file from a program you closed weeks ago has no downside.
How to prevent TMP files from piling up
The best prevention is to close programs normally instead of forcing them to quit. When you use File > Exit or click the X button and let the program shut down properly, it cleans up after itself. Forcing a quit (like using Task Manager on Windows or Force Quit on Mac) leaves TMP files behind.
Restart your computer regularly. When Windows or Mac restarts, it cleans out many temporary files automatically. If you leave your computer running for weeks without restarting, TMP files accumulate faster.
Run Disk Cleanup or your Mac's storage tools once a month. It only takes a few minutes and keeps the buildup from getting out of hand. If you work with large files regularly — video editing, photo work, or large spreadsheets — you might want to do it more often.
Frequently Asked Questions
Is it safe to delete all TMP files at once?
It's safe to delete old TMP files, but not while programs are running. Use your operating system's built-in cleanup tool rather than manually selecting all files, because the system knows which ones are currently in use. If you delete a TMP file that an active program needs, that program might crash.
Why does my computer keep creating new TMP files?
Every program creates temporary files while it's running — this is normal. The files should delete automatically when you close the program. If they're not deleting, it usually means programs are crashing instead of closing properly, or your computer isn't restarting often enough to trigger automatic cleanup.
Can TMP files contain important data I need?
Rarely. TMP files are meant to be temporary, and programs don't expect them to stick around. The only exception is if a program crashed and you're trying to recover unsaved work — in that case, the program itself will usually offer recovery options when you restart it, not by you manually digging through TMP files.
Do I need to delete TMP files if my computer is running fine?
No. If your computer has plenty of free disk space and isn't running slowly, TMP files aren't causing a problem. They're harmless when they're old and abandoned. You only need to clean them up if you're low on disk space or noticing performance issues.
What's the difference between a TMP file and a file I accidentally saved with a .tmp extension?
A real TMP file is created automatically by a program and has a random name like "tmp12345.tmp". A file you saved with a .tmp extension is a regular file you created. Real TMP files are safe to delete; files you saved are not.