A TMP file is a temporary file your computer creates while a program is running, then deletes when you close the program

When you open a document, edit a photo, or stream a video, your computer needs a place to store pieces of data while it works. A TMP file (short for temporary) is that holding space. The program creates it, uses it, and throws it away — usually without you ever seeing it. Most of the time this happens invisibly in the background.

Sometimes TMP files stick around after a program crashes or closes unexpectedly. When that happens, they pile up on your hard drive and take up space. They are harmless to delete, and your computer will create new ones the next time you need them.

Key Takeaways

  • TMP files are temporary storage your programs use while running, and they normally delete themselves when the program closes.
  • If a program crashes, TMP files may remain on your hard drive and waste storage space.
  • You can safely delete TMP files from your computer without breaking anything.
  • TMP files are usually hidden by default, so you may need to change your view settings to see them.

Why programs create temporary files

A program needs somewhere to put data while it is thinking. When you edit a document in Microsoft Word, the program does not change your original file when ready. Instead, it creates a temporary copy, makes your edits to that copy, and only saves the real file when you click Save. If your computer loses power before you save, the temporary file disappears and your original stays safe.

Video editing software, photo editors, and web browsers all do the same thing. A browser might create a temporary file to store part of a video while you watch it, or to hold cookies and cache data. Once you close the browser, those files go away. This approach protects your real files and lets programs work faster because they are not constantly rewriting your actual documents.

Where TMP files live on your computer

On Windows, temporary files usually sit in a folder called AppData\Local\Temp. You can reach it by typing %temp% into the address bar of File Explorer. On Mac, they live in /var/folders, though they are harder to find because the system hides them by default.

You do not need to know where they are most of the time. Your programs handle them automatically. The only reason to look is if your hard drive is running out of space and you want to clear out old temporary files that did not delete themselves.

When TMP files do not disappear

If a program crashes or your computer shuts down unexpectedly, the temporary files it created may stay behind. They sit in your Temp folder taking up gigabytes of space, even though no program needs them anymore. This is the main reason people notice TMP files at all — a full hard drive or a slow computer can be a sign that old temporary files have piled up.

Antivirus software sometimes quarantines a TMP file if it looks suspicious, which also prevents it from being deleted. In rare cases, a program may lock a temporary file so it cannot be removed while the program is still running.

How to find and delete temporary files safely

On Windows, open File Explorer and type %temp% into the address bar at the top, then press Enter. You will see a folder full of files and subfolders with names like tmp1a2b3c4d. Select all of them (Ctrl+A), then delete them (Delete key). Windows will skip any files that are currently in use and delete the rest.

On Mac, open Finder, press Command+Shift+G, type /var/folders, and press Enter. Navigate to the Temp folder inside. You can select and delete files the same way. If a file will not delete, it means a program is still using it — just leave it alone and move to the next one.

You can also use the built-in disk cleanup tool. On Windows, search for Disk Cleanup in the Start menu, select your hard drive, and check the box for "Temporary files." Click Clean up system files and let it run. This is safer than manually deleting because Windows knows which files are truly safe to remove.

The difference between TMP files and other temporary data

TMP files are not the same as cache files or cookies, though they serve a similar purpose. A cache file stores data a program or website uses often, so it loads faster next time. A cookie stores information about you (like login details or preferences). Both can be deleted, but they are stored in different places and managed differently than TMP files.

Browser temporary files, for example, usually live in a folder called Cache or Cookies inside your browser's settings, not in the main Temp folder. If you want to clear those, you go through the browser's settings menu rather than hunting through file folders.

When you should not delete temporary files

Do not delete a TMP file while the program that created it is still running. If you delete a file a program is actively using, the program may crash or behave strangely. This is why the safest approach is to close all programs first, then delete temporary files, or to use the built-in Disk Cleanup tool that knows which files are safe.

If you see a TMP file with a name that matches a program you are currently using, leave it alone. Once you close that program, the file will either delete itself or become safe to remove.

Frequently Asked Questions

Is it safe to delete all TMP files?

Yes. TMP files are meant to be temporary, and deleting them will not break your computer or programs. Windows will skip any files that are currently in use. The only risk is if you delete a file while a program is actively using it, which is why closing all programs first is the safest approach.

Why do TMP files take up so much space?

Large programs like video editors or 3D software create large temporary files while working on big projects. If the program crashes or you force-quit it, those files stay behind. A single video editing session can create gigabytes of temporary files, which is why your hard drive can fill up quickly if crashes happen often.

Can a TMP file be a virus?

Rarely. Viruses can hide inside any file type, including TMP files, but temporary files are not a common hiding place because they are deleted so often. If your antivirus software flags a TMP file as suspicious, it will usually quarantine it automatically. You do not need to manually hunt for infected TMP files.

Do I need to delete TMP files regularly?

Only if your hard drive is running low on space or your computer is running slowly. Most people never need to think about TMP files because they clean up automatically. If you notice your hard drive is full, clearing out old temporary files is a good first step before buying more storage.

What happens if a TMP file will not delete?

A file that will not delete is usually locked by a program that is still running. Close all programs and try again. If it still will not delete, restart your computer and try once more. If a file is truly stuck, you can usually ignore it — it is taking up minimal space and will eventually be overwritten.