A file extension is the short code at the end of a filename that tells your device what kind of file it is
When you save a document, photo, or video, your device adds a period and a few letters to the end of the name — like .docx, .jpg, or .mp4. That code is the extension. It is not decoration. Your device reads it to decide which program should open the file, and what rules explore to how the file works.
Without the extension, your device would have no way to know whether a file named "vacation" is a photo, a video, a text document, or something else entirely. The extension is the instruction manual attached to every file.
Key Takeaways
- File extensions are the letters after the period at the end of a filename, and they tell your device what type of file it is.
- Common extensions include .pdf for documents, .jpg for photos, .mp4 for videos, and .xlsx for spreadsheets.
- Changing or removing an extension does not change what the file actually is — it only confuses your device about how to open it.
- On Windows, extensions are often hidden by default, but you can turn on the option to see them in File Explorer settings.
- Different programs save files with different extensions even when they contain the same type of content, which is why a Word document ends in .docx but a Google Doc might end in .gdoc.
How extensions work on your device
When you double-click a file, your device looks at the extension first. It checks a list it keeps of which programs handle which extensions. If the extension is .pdf, your device opens the file with a PDF reader. If it is .xlsx, it opens Excel or a spreadsheet program. If your device does not recognize the extension, it will ask you which program you want to use, or it will refuse to open the file at all.
The extension also controls what your device lets you do with the file. A .exe file is executable — your device treats it as a program that can run. A .txt file is plain text — your device knows it contains only letters and numbers, no formatting. This separation keeps your device safer, because it prevents you from accidentally running a program when you thought you were opening a document.
Different devices use extensions differently. Windows and Mac both rely heavily on extensions to decide which program opens a file. Some phones hide extensions from you entirely, because the phone's operating system is designed to figure out file types on its own. But the extension is still there in the background, doing the same job.
Common extensions and what they mean
You will see the same extensions over and over. .pdf is a document format that looks the same on any device — it is read-only by default, which is why it is used for contracts and official papers. .docx is a Microsoft Word document; .doc is the older Word format. .xlsx is an Excel spreadsheet; .csv is a simpler spreadsheet format that any program can read.
For images, .jpg is the most common — it compresses photos to make them smaller, which is why it is used for photos on the internet. .png is similar but keeps more detail and supports transparency (see-through areas). .gif is an older format that supports straightforward animations. For video, .mp4 is the standard; .mov is Apple's format; .avi is an older Windows format.
For audio, .mp3 is the most common compressed format. .wav is uncompressed, which means it takes up much more space but sounds slightly better. .m4a is Apple's audio format. For compressed files that hold multiple files inside them, .zip is universal — almost every device can open a .zip file without installing anything new.
Why you should not change or remove extensions
Renaming a file and removing its extension does not change what the file actually is. If you have a photo named "vacation.jpg" and you rename it to "vacation" by deleting the .jpg, you have not turned it into a different kind of file. You have only hidden the instruction that tells your device it is a photo. When you try to open it, your device will not know what to do.
Some people think changing the extension will convert a file — for example, renaming a .jpg to a .png. It will not. The file is still a .jpg on the inside. All you have done is lied to your device about what it contains. The file will either refuse to open or open incorrectly.
The only time you should change an extension is when you are deliberately converting a file using a program designed to do that conversion. For example, if you use image editing software to open a .jpg and save it as a .png, the program rewrites the file in the new format. That is conversion. straightforward renaming the extension is not.
Why different programs use different extensions
Microsoft Word saves documents as .docx. Google Docs saves them as .gdoc. Apple Pages saves them as .pages. They all contain text and formatting, but each company uses its own extension because each program stores the information slightly differently on the inside.
This is why you sometimes cannot open a file in the program you expected. A .pages file opened in Word will not look right, because Word does not understand Apple's formatting code. The solution is to convert the file — open it in the original program and save it in a format the other program understands, usually .docx or .pdf.
Some extensions are universal, meaning almost any program that handles that type of file can read them. .pdf, .txt, .csv, and .zip are universal. Others are proprietary, meaning only one company's program reads them well. .docx is readable by many programs, but it works best in Word. .pages only works well in Apple Pages.
How to see file extensions on your device
On Windows, extensions are hidden by default. To see them, open File Explorer, click the View tab at the top, and check the box next to "File name extensions". From then on, you will see the full filename including the extension for every file.
On Mac, open Finder, select a file, press Command and I together to open the file information window, and look for "Name and Extension" — you will see the extension there. To show extensions for all files at once, open Finder preferences, click the Advanced tab, and check "Show all filename extensions".
On phones and tablets, extensions are usually hidden because the operating system handles file types automatically. If you need to see them, you can use a file manager app from the app store, which will show extensions for files stored on your device.
What happens when your device does not recognize an extension
If you receive a file with an extension your device has never seen, or if the extension is misspelled, your device will not know which program to use. On Windows or Mac, you will see a dialog asking "What program do you want to use to open this file?" You can choose any program from the list, but the file may not open correctly if the program does not actually support that file type.
Sometimes a file arrives with no extension at all. This usually happens when a file is transferred between different types of devices or downloaded from the internet in a way that strips the extension. If you know what kind of file it is — a photo, a document, a video — you can add the correct extension back by renaming the file. Right-click it, select Rename, and add the period and extension to the end.
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 device thinks the file is. To actually convert a file, you must open it in a program designed to do conversions, then save it in the new format. For example, use image editing software to open a .jpg and save it as a .png.
Why do some files have two extensions, like .tar.gz?
Some files are compressed or packaged multiple times. .tar.gz means the file was first packaged into a .tar archive, then compressed with gzip (.gz). Your device reads both extensions to understand the full process needed to unpack it. You usually do not need to do anything — your device handles it automatically.
Is it safe to open a file with an extension I do not recognize?
Be cautious. If you do not know what a file is or where it came from, do not open it. Dangerous files sometimes use misleading extensions — for example, a program disguised with a .txt extension. If you trust the source, you can try opening it with a safe program like a text editor first to see what is inside.
What is the difference between .jpg and .jpeg?
They are the same thing. .jpg is a shortened version of .jpeg (Joint Photographic Experts Group). Your device treats them identically. Some older programs use .jpeg, and newer ones use .jpg, but both work everywhere.
Can I have a file with no extension?
Yes, but your device will not know what program to use to open it. Files without extensions are common on Mac and Linux, but on Windows they cause problems. If you have a file with no extension and you know what type it is, add the correct extension by renaming the file.