A filename extension tells your computer what kind of file it is
A filename extension is the short code at the very end of a filename, after the dot. It tells your computer what program should open the file and what kind of information is inside. For example, a file named budget.xlsx has the extension .xlsx, which means it is a spreadsheet. A file named photo.jpg has the extension .jpg, which means it is a photograph.
Without the extension, your computer would have no way to know whether a file named document is a word processor file, a text file, a video, or something else entirely. The extension is the instruction that makes the file actually work.
Extensions are usually two to four letters long. They are always separated from the rest of the filename by a single dot, with no space between them. The extension comes last — nothing should appear after it except in rare cases where your computer adds its own code.
Key Takeaways
- The extension is the letters after the final dot in a filename, and it tells your computer what program to use to open the file.
- Common extensions include .docx for Word documents, .pdf for PDFs, .jpg for photos, .mp4 for videos, and .xlsx for spreadsheets.
- If you change or delete an extension by accident, the file still exists but your computer may not know how to open it.
- Hiding extensions in your file manager can make it harder to spot problems, so turning them on is useful when you are organizing files.
Common extensions and what they mean
Here are the extensions you will see most often:
| Extension | File Type | What It Is |
|---|---|---|
| .docx | Word document | Text document created in Microsoft Word or compatible programs |
| PDF document | Document that looks the same on any computer; cannot be edited easily | |
| .xlsx | Excel spreadsheet | Spreadsheet with rows, columns, and formulas |
| .jpg or .jpeg | Photograph | Compressed image file; standard for photos |
| .png | Image file | Image with better quality than .jpg; supports transparency |
| .mp4 | Video file | Video that plays on most devices and media players |
| .mp3 | Audio file | Music or voice recording |
| .txt | Text file | Plain text with no formatting; opens in any text editor |
| .zip | Compressed folder | Multiple files squeezed into one smaller file |
If you see an extension you do not recognize, you can search for it online along with the word "file type" to find out what program opens it. Many extensions are specific to one industry or profession — for example, .psd is used by graphic designers, and .dwg is used in architecture.
Why extensions matter when you organize files
When you are sorting through folders and trying to find what you need, extensions help you spot problems before you open a file. If you see a file named taxes_2024.mp4, the extension tells you when ready that it is a video, not a spreadsheet — which means something went wrong when you saved or renamed it.
Extensions also help you understand what will happen when you double-click a file. A .pdf file will open in your PDF reader. A .docx file will open in Word or a compatible program. A .jpg file will open in your photo viewer. Knowing the extension means you know what to expect.
When you rename files to organize them better, keeping the extension intact is essential. If you change photo.jpg to vacation photo by accident and delete the .jpg, your computer will no longer know it is a photo. The file still exists, but it becomes much harder to open.
How to see extensions on your computer
On Windows, extensions are often hidden by default. To turn them on, open File Explorer, click the View tab at the top, and check the box next to "File name extensions". After you do this once, extensions will stay visible in that folder and most others.
On a Mac, open Finder, click Finder in the menu bar, select Preferences, click the Advanced tab, and check the box next to "Show all filename extensions". This makes extensions visible across your entire computer.
Once extensions are visible, you will see them on every file. This makes it much easier to spot when a file has the wrong extension or when something has been mislabeled during saving.
What happens if you change or delete an extension
If you rename a file and accidentally remove or change its extension, the file itself does not disappear — but your computer may not know how to open it. For example, if you change budget.xlsx to budget, the spreadsheet is still there, but clicking it might produce an error or open it in the wrong program.
You can fix this by renaming the file again and adding the correct extension back. Right-click the file, select Rename, and type the full filename with the correct extension at the end. Your computer will recognize it again when ready.
Some files have double extensions, like document.backup.docx or archive.tar.gz. In these cases, only the final extension matters for opening the file — the earlier ones are usually part of the actual filename and describe what the file is.
Extensions and file security
Malicious files sometimes use misleading extensions to trick you into opening them. For example, a file might be named invoice.pdf.exe — it looks like a PDF, but the real extension is .exe, which means it is a program that could harm your computer. This is why seeing extensions is important: it helps you spot when something does not match what the filename suggests.
If you receive a file from someone you do not know and the extension seems wrong for what they said it was, do not open it. Ask them to resend it or verify that they meant to send that type of file.
Frequently Asked Questions
Can I change a file's extension to convert it to a different format?
No. Changing the extension does not convert the file — it only changes what your computer thinks the file is. If you rename photo.jpg to photo.png, your computer will try to open it as a PNG, but the file is still a JPG inside, and it may not display correctly. To actually convert a file, you need to use a program designed for that conversion.
Why do some files have extensions and others do not?
On older computers and some systems, extensions were optional or hidden. On modern Windows and Mac computers, every file has an extension, but your operating system may hide them by default to make filenames look simpler. Turning on the view option shows all extensions that are actually there.
What if a file has no extension at all?
Files without extensions can still work, but your computer has to guess what program to use. This is rare on Windows and Mac. If you encounter a file with no extension and you know what type it is, you can rename it and add the correct extension to make it easier to open.
Are extensions case-sensitive?
On Windows, extensions are not case-sensitive — .JPG, .jpg, and .Jpg all work the same way. On Mac and Linux, they technically are case-sensitive, but most programs treat them the same. For consistency, use lowercase extensions.
Can I use the same extension for different types of files?
No. Each extension is designed for one specific file format. Using the wrong extension confuses your computer and other people who receive your files. Always use the correct extension for the file type you are saving.