File extensions are the characters after the period in a file name that tell the operating system which program to use when opening that file. Understanding how extensions work—and how to view, change, and manage them in Windows—is a foundational skill for working with files and applications.
File Extensions
How does your computer know what documents are associated with what programs? It all has to do with file extensions.
We end up with a lot of programs on our computer that are doing different tasks, and somehow when we open up a document it just automatically knows what program that document is associated with.
File extensions are part of the file name. For instance, we have a file right here named file, and it is a txt. The extension is anything after the period, so in this case the txt is the extension for this file. What it does is specify what program it will use to open it up. A lot of times txt on a Windows machine is associated with a text file and will be opened up with Notepad.
I'm on a Windows machine, so let's see what these extensions look like. What I'm going to do is right-click on the screen and say new, and we're going to create a new text document, and I'm just going to call this file. So now we've got this text document that's named file. If I hover over it, I can see that the type is a text document, and as I mentioned, a text document is associated with a txt. So this has a file.txt, but we don't see that txt — it's hidden right now.
What I can do is open this up. If I double-click on it, it will automatically choose Notepad to open it up, since that's associated with this txt file. And with it open I can actually see that txt, so that file does actually have a txt at the end of it. But where is it?
Let's go ahead and show that. What I'm going to do is click on the start menu and type in extensions, and it will pop up, and it says show file extensions right here. I'm going to click that on, and now we can see that it's a file.txt. So now I can actually see those. The operating system hides that extension by default, and I have to turn it on to be able to view it.
Now let's watch what happens if I change the extension. We're going to change it to a jpg, which is a JPEG, which is a picture. I'm going to hit enter and it gives me a warning, because it says you might not be able to open this up if we do this, because it's going to be associated with a different program that might not be able to open it up. So do you want to do this? And yes, we do.
Now the icon has changed. If I hover over it, we can see it's a JPG file, and if I try to open it, it's going to use the program associated with JPG, which is this picture program. Because there's not really anything in it, it's saying sorry, we can't open this up. So we've just caused a problem with this. Now, if I want this to open up, what I can do is go back and associate it with .txt again. We'll click on yes, and now I can open it up — it'll choose successfully.
Here are some examples of file extensions, and as you can see, they're about three or four characters, although there are some ones that I've seen that are quite a bit longer.
Here are some different types of extensions. Images has a lot of different extensions associated with it — it could be a JPEG, it could be a GIF, it could be a TIFF, it could be a bitmap, so these are different formats for images. We have audio, so there are different extensions associated with audio. There are different scripts out there. There are different compression formats that are out there, and each one has its own extension that's associated with it.
In one of the other lessons I mentioned distribution methods, how we distribute software. We could distribute it on a disk, which is an ISO or DMG or one of the other disk formats. We see that a program is an EXE or MSI or PKG. We see that there's CIS or INF or DLLs out there. We see BAT, PS1s, bash, if it's some sort of script. We see compression software and the different formats associated with compression software.
There are different programs that are associated with different extensions, and sometimes we want to change that. When we go through the install process for something like, let's say, a new word processor, it will ask you if you want to associate these different file formats with the new program.
So we can actually look up what the different extensions are and what programs they're associated with. Let's do that now. What we're going to do is click the start menu, and with the start menu we're going to type in default apps, and we're going to hit enter on the default apps. By default we're going to be able to see what programs are associated with each one of these files. For instance, we've got Adobe Acrobat here. We can go into it and we can see all of the different extensions that are associated with this program, so there's a lot associated with it. If we wanted to change this, then I could click on this to change the program.
Let's go and take a look at another one. Another popular one is web browsing, so some of the stuff is associated with Edge or Google Chrome. Let's click on Google Chrome and we can see HTM, HTML — different file formats are now associated with Google Chrome.
Let's go ahead and click on the start button here, and I'm going to type in default, and we'll go into the default apps, and let's just choose one of these. I'm going to go and find Google Chrome, so we're going to get down to Google Chrome, I'll click on it, and now what it's showing us is that HTM is associated with Google Chrome, HTML is with Google Chrome, mhtml — that extension is associated with Microsoft Edge — or PDF is associated with Adobe Acrobat. So we can see the different extensions and what programs they're associated with.
This raises an interesting point. As you can see, both HTM and HTML are associated with Google, so more than one extension can be associated with an app.
Not only can different extensions be associated with these different programs, but the program itself a lot of times can save in different formats. Let's take a look at Paint as an example of this. What I'm going to do is click on the start menu and type in paint, and we'll hit enter.
Let's say I create some sort of drawing. We've got some sort of drawing that we create, and we want to save this. I'm going to do file, save as, and notice I can do it as a PNG, a JPEG, a BMP, a GIF. So we've got these different formats that we can save as, and it actually compresses it a little differently, or saves it a little differently, with each one of these. Bitmap, as an example, saves it uncompressed, versus JPEG, which has a compression to it.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →