A file extension is the short code at the end of a filename that tells your computer what kind of file it is
When you save a document, photo, or video, the filename ends with a dot followed by a few letters — like .docx, .jpg, or .mp4. That ending is the file extension. It is a label that tells your operating system (Windows, Mac, or Linux) what program should open the file and how to read the data inside.
Without the extension, your computer would have no way to know whether a file is a spreadsheet, an audio recording, or executable code. The extension is not part of the actual filename — it is metadata that your system reads automatically. When you double-click a file, Windows or Mac looks at the extension first, then launches the correct program to open it.
Extensions are also why you cannot simply rename a .jpg file to .mp4 and expect it to play as a video. The extension is just a label. Changing the label does not change what is actually inside the file.
Key Takeaways
- File extensions are the letters after the dot at the end of a filename, and they tell your computer what kind of file it is and which program should open it.
- Common extensions include .docx for Word documents, .xlsx for spreadsheets, .jpg for photos, .mp4 for videos, and .pdf for portable documents.
- Changing a filename's extension does not change the file itself — it only changes the label your computer reads.
- Some files have double extensions like .tar.gz, which means the file was compressed and then archived, and both steps must be reversed to use it.
- On Windows, extensions are often hidden by default, but you can turn on the option to see them in File Explorer settings.
Why your computer needs file extensions
Your computer stores millions of files as streams of ones and zeros. The extension is the instruction manual that says "read this stream as a photograph" or "read this stream as a text document." Without it, the system would have to guess, and it would guess wrong most of the time.
When you double-click a file, your operating system checks the extension against a list of associations — a registry on Windows or a preferences file on Mac — that says ".docx files open with Microsoft Word" or ".mp3 files open with the default music player." If the extension is missing or wrong, the file will either fail to open or open in the wrong program.
Extensions also let you sort and filter files. If you search for "*.jpg" in File Explorer or Finder, you are asking the system to show you only files with that extension. Without extensions, there would be no way to do that search.
Common file extensions and what they mean
Different types of files have different extensions. Here are the ones you will encounter most often:
| Extension | File Type | Opens With |
|---|---|---|
| .docx | Word document | Microsoft Word, Google Docs |
| .xlsx | Excel spreadsheet | Microsoft Excel, Google Sheets |
| Portable document | Adobe Reader, web browser | |
| .jpg or .jpeg | Photograph or image | Photos app, web browser, image editor |
| .png | Image with transparency | Photos app, web browser, image editor |
| .mp4 | Video file | Media player, web browser |
| .mp3 | Audio file | Music player, web browser |
| .zip | Compressed folder | Built-in compression tool (Windows or Mac) |
| .exe | Windows program | Runs directly when double-clicked |
| .txt | Plain text | Notepad, any text editor |
The extension tells you what the file contains, but it does not tell you the quality or size. A .jpg file could be a tiny thumbnail or a massive high-resolution photo. A .mp4 could be a 10-second clip or a two-hour movie. The extension is just the category.
Why extensions are hidden on Windows by default
If you open File Explorer on a Windows computer, you probably do not see the extensions at the end of filenames. Microsoft hides them by default because the company decided most users do not need to see them. The system handles the extension automatically, so you do not have to think about it.
However, hiding extensions can be a security risk. Malware creators sometimes use double extensions to trick you — for example, a file might be named "document.pdf.exe", but if extensions are hidden, you would only see "document.pdf" and think it was a safe PDF. When you double-click it, the .exe program runs instead.
To turn on extensions in Windows 10 or 11, open File Explorer, click the View tab at the top, and check the box next to "File name extensions." On a Mac, open Finder, go to Preferences, and check "Show all filename extensions." Once you turn this on, you will see the extension on every file.
What happens when you change a file extension
You can rename a file and change its extension, but this only changes the label — not the actual data inside. If you rename "photo.jpg" to "photo.mp4", your computer will try to open it as a video file, and it will fail because the data inside is still a photograph.
Sometimes changing the extension is necessary. For example, if you download a file that lost its extension, or if you need to convert a file to a different format. But conversion is not the same as renaming. To actually convert a .jpg to a .png, you need to open it in an image editor and save it in the new format. Simply changing the extension will not do that.
If you are unsure whether renaming an extension is safe, do not do it. Make a copy of the file first, rename the copy, and see what happens. If it does not work, you still have the original.
Double extensions and what they mean
Some files have two extensions, like "archive.tar.gz" or "backup.sql.zip". This usually means the file went through two processes. A .tar.gz file, for example, was first archived (bundled together) with tar, then compressed with gzip. To use it, you have to reverse both steps — decompress it first, then unarchive it.
Most of the time, your operating system handles this automatically. You double-click the file, and the system knows to decompress and then unarchive. But if it does not work, you may need to use a third-party tool like 7-Zip or WinRAR to handle the decompression manually.
Double extensions are common in backups, software downloads, and files that have been processed multiple times. They are not dangerous — they just mean there is more than one layer to unwrap.
How to find the right program for an unfamiliar extension
If you receive a file with an extension you do not recognize, do not panic. Search the internet for the extension in quotes — for example, ".webp file" — and you will find out what it is and which programs can open it. Most unfamiliar extensions are just less common formats for photos, documents, or video.
If you do not have the right program installed, you have a few options. You can download a free program that handles that file type, or you can ask the person who sent you the file to resend it in a more common format. Many online converters also let you upload a file and download it in a different format, though you should be cautious about uploading sensitive documents to unknown websites.
If the extension is .exe or .msi (Windows installer), and you did not expect to receive it, do not open it. These are executable files that run programs, and they can contain malware. Only run .exe or .msi files from sources you trust.
Frequently Asked Questions
Can I change a file extension to open it in a different program?
Changing the extension will only change which program tries to open it — it will not change the data inside. If you rename a .docx file to .txt, your computer will try to open it as plain text, and it will show garbled characters. To actually convert a file to a different format, you need to open it in the correct program and save it in the new format.
Why do some files not have extensions?
On Mac and Linux, extensions are optional because the system can read file metadata without them. On Windows, files almost always have extensions. If a Windows file is missing its extension, it was either deleted by accident or the person who created it did not add one. You can usually figure out what type it is by right-clicking it and looking at the file properties.
Is it dangerous to see file extensions?
No — in fact, it is safer. Seeing extensions helps you spot malware tricks like "document.pdf.exe", where the real extension is hidden. Turn on "Show file name extensions" in your operating system settings. It will not break anything, and it will help you spot suspicious files.
What does the dot before the extension mean?
The dot is a separator that tells your operating system where the filename ends and the extension begins. It is not part of either one — it is just punctuation. The system reads everything after the last dot as the extension.
Can I have multiple dots in a filename?
Yes. A file named "my.document.final.docx" is perfectly valid. Your operating system reads only the extension after the last dot — in this case, .docx. Everything before that last dot is part of the filename.