File extensions tell your computer what program should open a file

A file extension is the short code at the end of a filename, after the dot. When you see a file named "budget.xlsx" or "photo.jpg" or "letter.docx", the part after the dot — xlsx, jpg, docx — is the extension. It is a label that tells your operating system what kind of information is inside the file and which program knows how to read it.

Without extensions, your computer would have no way to know whether a file contains a spreadsheet, a photograph, a document, or something else entirely. When you double-click a file, your computer reads the extension and launches the correct program. A .jpg file opens in your photo viewer. A .docx file opens in Word or a compatible word processor. A .mp3 file opens in your music player.

Extensions are not just labels for humans — they are instructions your computer follows automatically. If you rename a file and change or remove its extension, the file itself does not change, but your computer may no longer know what to do with it.

Key Takeaways

  • File extensions are the letters after the dot in a filename, and they tell your computer which program should open the file.
  • Common extensions include .docx for Word documents, .xlsx for spreadsheets, .jpg for photos, and .pdf for documents that should not be edited.
  • Changing or hiding an extension can make a file unreadable or cause it to open in the wrong program.
  • Organizing files by extension — keeping all photos together, all documents together — makes them easier to find and back up.

How extensions connect files to the right programs

Your computer stores a list of which programs handle which extensions. When you install Microsoft Word, the installation process tells your system that .docx files belong to Word. When you install Photoshop, it claims .psd files. This connection is called a file association.

You can change which program opens a file type. Right-click a file, choose "Open with", and select a different program. You can also set a new default program for that extension in your system settings. But the extension itself — the three or four letters after the dot — stays the same and keeps working as a label.

Some files have multiple extensions stacked together. A file named "report.backup.docx" has two extensions: .backup and .docx. Your computer reads the last one (.docx) and opens it in Word. The .backup part is just extra information the user added to the filename to remember that this is an older version.

Common extensions and what they mean

You will see the same extensions repeatedly as you organize your files. Learning what they stand for helps you understand what each file contains and where it belongs in your folder structure.

ExtensionFile TypeWhat It Opens In
.docxWord documentMicrosoft Word, Google Docs, LibreOffice
.xlsxSpreadsheetMicrosoft Excel, Google Sheets, LibreOffice Calc
.pdfPortable documentAny PDF reader (Adobe Reader, browser, preview app)
.jpg or .jpegPhotograph or imagePhoto viewer, web browser, image editor
.pngImage with transparencyPhoto viewer, web browser, image editor
.mp3Audio fileMusic player, media player
.mp4Video fileVideo player, media player
.txtPlain textNotepad, any text editor
.zipCompressed folderBuilt-in compression tool (Windows, Mac)

When you are organizing files, grouping them by extension is often the easiest way to start. Put all your .jpg and .png files in a Photos folder. Put all your .docx and .pdf files in a Documents folder. This makes backups faster and helps you find things without scrolling through mixed file types.

Why extensions sometimes disappear from view

On Windows and Mac computers, extensions are often hidden by default. You might see a file named "budget" instead of "budget.xlsx". This is meant to make filenames look cleaner, but it can cause confusion when you are trying to organize files or understand what you are looking at.

You can turn on extension visibility in your system settings. On Windows, open File Explorer, click View, and check the box for "File name extensions". On Mac, open Finder, go to Preferences, and check "Show all filename extensions". Once you turn this on, you will see the full filename including the extension on every file.

Showing extensions is especially useful when you are organizing files, because you can see at a glance what type each file is. It also prevents accidental mistakes — you will notice if you accidentally renamed a file and changed its extension, because you will see the change when ready.

What happens when you change or remove an extension

If you rename a file and accidentally delete or change its extension, the file itself does not change — the data inside stays exactly the same. But your computer no longer knows what program should open it. You might double-click the file and get an error message, or it might open in the wrong program entirely.

For example, if you rename "photo.jpg" to "photo" (removing the extension), your computer will not recognize it as a photograph. If you rename it to "photo.txt", your computer will try to open it as a text file, which will show gibberish on your screen.

The fix is straightforward: rename the file again and add the correct extension back. If you are not sure what the extension should be, look at similar files in the same folder, or check the file's properties (right-click and choose Properties or Get Info) to see what type it is.

Using extensions to organize and back up files

When you are setting up your folder structure, extensions help you decide where files belong. You might create separate folders for Documents, Photos, Videos, and Audio. Within Documents, you might have subfolders for Receipts, Tax Returns, and Contracts. Each of these folders will contain files with specific extensions — .pdf and .docx in Documents, .jpg and .png in Photos, .mp4 in Videos.

This organization by file type makes backups much faster. If you need to back up only your photos, you know exactly which folder to copy. If you need to find all your tax documents, you know they will all be in one place with similar extensions. It also makes it easier to notice if a file is in the wrong location — a .mp3 file in your Documents folder stands out when ready.

Extensions also help when you are cleaning up old files. If you want to delete all your temporary files, you can search for .tmp or .temp extensions. If you want to find all your Word documents across your entire computer, you can search for *.docx (the asterisk is a wildcard that means "any filename").

Frequently Asked Questions

Can I change a file's extension to change what type of file it is?

No. Changing the extension only changes the label — it does not change what is actually inside the file. If you rename a photograph from photo.jpg to photo.docx, it is still a photograph, but your computer will try to open it as a Word document and show you gibberish. The file itself is unchanged and unharmed; you just need to change the extension back.

What if a file has no extension?

Files without extensions are usually created on older systems or Unix-based computers. Your computer may not know what program to use to open them. You can try right-clicking and choosing "Open with" to pick a program manually, or you can add an extension to the filename if you know what type of file it is. If you are unsure, check the file's properties or ask whoever sent it to you.

Why do some files have two extensions, like .backup.docx?

The second extension (the one closest to the end) is what your computer uses to decide which program opens the file. The first extension is just part of the filename and is meant to help you remember something about the file — in this case, that it is a backup copy. You can name files however you want before the final extension.

Do I need to know all the extensions?

No. You only need to recognize the ones you use regularly — .docx, .xlsx, .pdf, .jpg, and a few others depending on your work. If you encounter an unfamiliar extension, you can search for it online or check the file's properties to learn what it is.

What is the difference between .jpg and .png?

Both are image formats, but .png can store images with transparent backgrounds, while .jpg cannot. Use .png for graphics and logos where you need transparency. Use .jpg for photographs and images where file size matters, because .jpg files are usually smaller. Both open in the same programs and look similar on screen.